Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard should also check files that are in .gitignore but added to git #1104

Closed
KSXGitHub opened this issue Mar 31, 2018 · 1 comment

Comments

@KSXGitHub
Copy link

commented Mar 31, 2018

Steps to reproduce

  1. Create a file that violates standardjs rules: invalid.js
  2. Add invalid.js (or *, invalid.*, etc.) to .gitignore
  3. Run git add -f invalid.js and git commit
  4. Run standard

Expected behaviour

standard should print error messages for invalid.js

Current behaviour

standard ignores invalid.js

@feross feross added the question label May 23, 2018

@feross

This comment has been minimized.

Copy link
Member

commented May 23, 2018

@KSXGitHub Thanks for the thoughtful issue with reproduction steps. 👍

I don't think we should support this feature request. I know this is a little bit counter-intuitive since we use .gitignore when it exists to populate the ignored patterns list.

However, I don't think it's standard's job to execute git commands or to inspect the contents of the .git folder to determine which files have been force-added.

Just to sanity check this thought-process, I tested the exact same set of steps you listed with npm's support for .gitignore in npm publish and I noticed that they also don't support force-added files. In other words, if you .gitignore a file, then it won't get published to npm even if it has been force-added.

I'm sorry that this affects your use case. Hopefully you can find a workaround.

@feross feross closed this May 23, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Aug 26, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.