negation-of-excluded-parent
What it does
Section titled “What it does”Reports a ! pattern for a path whose parent directory is excluded by an earlier pattern (!a/b after a/). Only literal paths are checked. In .dockerignore, where the later pattern wins, it is not reported.
Why it matters
Section titled “Why it matters”Git does not look inside an excluded directory, so it cannot re-include a file in it, and the negation does nothing. The file stays ignored although the file seems to say otherwise.
To fix, exclude the contents instead of the directory (a/*), then add the negation.
Example
Section titled “Example”node_modules/!node_modules/keep.js/a/b!/a/b/c*.o!/lib/a.ovendor/...Configuration
Section titled “Configuration”gitignore: lint: rules: negation-of-excluded-parent: warn # off, warn (default), errorSuppress one line with sudsy-disable-next-line negation-of-excluded-parent in a comment of the file’s language.