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

Marks files ignored based on a line that was a comment #1

Closed
Aigeec opened this issue Jan 23, 2018 · 3 comments
Closed

Marks files ignored based on a line that was a comment #1

Aigeec opened this issue Jan 23, 2018 · 3 comments

Comments

@Aigeec
Copy link
Contributor

Aigeec commented Jan 23, 2018

Example if a .gitignore read as follows:

# project-folder-name
coverage

I would expect only the coverage folder to be ignored. How ever any files with the project-folder-name in their path i.e. all files are considered shouldIgnore.

If you take a look at minimatch you will see that the makeRe method and the Minimatch constructor do not take the same options.

The below code attempts to pass the properties for the Minimatch class to the makeRe method

var match = minimatch.makeRe(line, {
      comment: commentLine,
      empty: emptyLine,
      matchBase: !rootedLine,
      negated: true // negated
    })

The properties are ignored and the match is made. I noticed this is the standard-version module.

@ericksoen
Copy link
Contributor

@Aigeec Thanks for working on this. I ran into the same issue on one of my projects and came to the same conclusion you did.

@jimlindeman
Copy link

jimlindeman commented Jul 4, 2018

Had issue where the .gitignore had

# ignore build directory
build

which then triggered false positive on everything in the Travis build base path: /home/travis/build/git-project/git-repo when standard-version was trying to identify the package.json.

So we need this logic to determine its working directory and only apply the .gitignore filters for folders underneath that.

@bcoe bcoe closed this as completed in #3 Dec 24, 2018
@bcoe
Copy link
Owner

bcoe commented Dec 24, 2018

@jimlindeman mind opening a new issue? I believe this is a different problem related to the check being too permissive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants