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

"is covered by" is wrong #228

Closed
mnpenner opened this issue May 24, 2016 · 11 comments
Closed

"is covered by" is wrong #228

mnpenner opened this issue May 24, 2016 · 11 comments

Comments

@mnpenner
Copy link

Running version 1.4.1 now.

This warning is giving false positives:

image

~$ is not covered by (?<![^/])\. nor ^node_modules/.

Most of those "entry is never used" warnings are wrong too actually.

@hsz hsz added the bug label May 25, 2016
@jwfearn
Copy link

jwfearn commented May 31, 2016

Here's another one I found:
image

@hsz hsz added this to the 1.5 milestone Jun 11, 2016
@hsz
Copy link
Member

hsz commented Jun 13, 2016

@mnpenner @jwfearn

Those rules are marked as covered because the rule that is marked as covering those subrules.

For example ~$ matches some files that ends with ~ character but they are located under the node_modules directory and nowhere else.

If you'll create some template foo~ file in the root directory - it will not be matched as covered by ^node_modules/ directory.

Can you please verify it ?

@mnpenner
Copy link
Author

I created a new file called derp~ inside the root of my project directory, and that warning did indeed go away. However, I then moved the file into another ignored directory, and the warning did not re-appear to tell me it was covered by the other directory. Lastly, I removed ^node_modules/ and ~$ from my .hignore and then did hg st | grep '~' to see what files were being covered, and there does not appear to be any ~ files in my node_modules directory. find . -name *~ only finds my one derp~ file too, so I don't think I have any other ~ files. If that's the case, how can ^node_modules/ be covering it?

@Alexsey
Copy link

Alexsey commented Jun 19, 2017

screen shot 2017-06-19 at 20 25 20

@hsz
Copy link
Member

hsz commented Aug 24, 2017

Can I ask you to check if this issue is still present in v2.1.1?

@Alexsey
Copy link

Alexsey commented Aug 24, 2017

screen shot 2017-08-24 at 14 25 35

screen shot 2017-08-24 at 14 25 59

@mnpenner
Copy link
Author

I don't seem to have any "is covered by" warnings anymore, but I have a lot of incorrect "entry is never used" warnings, which I've verified by removing the line and running hg stat again. The number of untracked files changes, so these rules are definitely doing something.

@charlwillia6
Copy link

Every single line for me says "entry is never used." This is in Rider 2017.2 EAP. My .gitignore file is in the root of my project. My project structure looks like:

|-- .git
|-- Help
|-- src
-- .gitattributes
-- .gitignore
-- Docs.shfbproj
-- README.md

I used direct paths to some directories and files, so there really is no reason for it.

@toolforger
Copy link

@mnpenner find . -name *~ does not do what you think it does, because the *~ will be interpreted by the shell, not by find.
You should say find . -name "*~" instead.

@mnpenner
Copy link
Author

@toolforger Thanks. That does indeed turn up a whole bunch of files under node_modules but it doesn't explain why this plugin thinks the ~$ rule is unused. Adding and removing that line from .hgignore changes the output of hg stat, so one way or another, it's used.

@hsz hsz modified the milestones: 1.5, v3.1.0 May 7, 2019
@hsz
Copy link
Member

hsz commented May 13, 2019

Fixed and released with v3.1.1

@hsz hsz closed this as completed May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants