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

ignoring exact path file still counts as error #2

Closed
gergoszabo opened this issue Jan 13, 2020 · 3 comments
Closed

ignoring exact path file still counts as error #2

gergoszabo opened this issue Jan 13, 2020 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@gergoszabo
Copy link

gergoszabo commented Jan 13, 2020

I found an issue regarding ignoring exact matches, here is the necessary steps to reproduce the issue:

Given the following path-linter.json:

{
    "severity": "error",
    "rules": [{  
        "directory": "src",  
        "rule": "kebab-case",  
        "ignore": [ "__tests__", "__mocks__", "src/Gya.ts" ]  
    }]
}

Execute the following commands (assuming linux shell):

touch src/Gya.ts
yarn test-run:default

Here is the output:

[info] Started linting src...
[error] src/Gya.ts does not match kebab-case!
[info] Finished linting src!
[info] Linted 37 file(s), 1 didn't match pattern.

The path gets recognized correctly.
Then it matches one of the ignore pattern, so it will get replaced to an empty string in src/util/string.utils.ts.
When src/linter/linter.ts processes the path (empty string) it returns false.

Could you please clarify if this is intended or a fix needed? :)

@attilagyongyosi attilagyongyosi self-assigned this Jan 13, 2020
@attilagyongyosi attilagyongyosi added the bug Something isn't working label Jan 13, 2020
@attilagyongyosi
Copy link
Owner

Thanks for opening a detailed issue :)
When you ignore a full (although relative) path, expected behavior should be that the linting passes on it, so it is indeed a bug.
Fixing is in progress.

@attilagyongyosi attilagyongyosi added this to the v2.1.0 milestone Jan 17, 2020
@attilagyongyosi
Copy link
Owner

Proper path portion / full project path ignoring has been implemented in 2.1.0, which is now also platform-independent.
Travis CI jobs have been configured to automatically execute tests on both Linux & Windows.

@Gary89 please verify :)

@gergoszabo
Copy link
Author

I can confirm, the issue is resolved with 2.1.0. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants