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

Include inline ignored violations when --no-ignore flag is used #55

Merged
merged 5 commits into from
Mar 6, 2021

Conversation

caitlinelfring
Copy link
Member

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug fix

What is the current behavior? (You can also link to an open issue here)
Running woke with --no-ignore processes ignored files, but continues to skip inline ignores. Fixes #54

What is the new behavior (if this is a feature change)?
Running woke --no-ignore now processes both ignored files and inline ignores

Does this PR introduce a breaking change? (What changes might users need to make due to this PR?)
Lines ignored with an inline ignore will now be processed when using the --no-ignore flag

Other information:

inline ignores will be determined if it should skip within the parser, instead of inside FindResults. This means we can determine if `no-ignore` has been passed by the presence of a non-nil `Ignore`
@codecov
Copy link

codecov bot commented Mar 5, 2021

Codecov Report

Merging #55 (1593105) into main (69f1664) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #55   +/-   ##
=======================================
  Coverage   95.87%   95.87%           
=======================================
  Files          19       19           
  Lines         461      461           
=======================================
  Hits          442      442           
  Misses         11       11           
  Partials        8        8           
Impacted Files Coverage Δ
pkg/result/lineresult.go 100.00% <ø> (ø)
cmd/root.go 84.21% <100.00%> (ø)
pkg/parser/parser.go 100.00% <100.00%> (ø)
pkg/parser/violations.go 94.59% <100.00%> (+1.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69f1664...1593105. Read the comment docs.

@caitlinelfring
Copy link
Member Author

$ cat foo
Hey, check out this whitelist! // wokeignore:rule=whitelist
$ ./woke foo
No violations found. Stay woke ✊
$ ./woke foo --no-ignore
foo:1:20-29: `whitelist` may be insensitive, use `allowlist` instead (warning)
Hey, check out this whitelist! // wokeignore:rule=whitelist
                    ^
$ ./woke foo --no-ignore --debug
2021-03-05T19:29:45-05:00 DBG woke version main built from 000000 on today
2021-03-05T19:29:45-05:00 DBG rules enabled rules=["blackbox","blacklist","dummy","grandfathered","guys","man-hours","master-slave","sanity","slave","whitebox","whitelist"]
2021-03-05T19:29:45-05:00 DBG created new printer printer=text
2021-03-05T19:29:45-05:00 DBG process files path=foo type=parallel
2021-03-05T19:29:45-05:00 DBG finished processing violations durationMS=0.143625 file=foo
foo:1:20-29: `whitelist` may be insensitive, use `allowlist` instead (warning)
Hey, check out this whitelist! // wokeignore:rule=whitelist
                    ^
2021-03-05T19:29:45-05:00 DBG woke completed durationMS=0.928502

@juliahw
Copy link

juliahw commented Mar 6, 2021

Thank you!

@caitlinelfring caitlinelfring merged commit e33a005 into main Mar 6, 2021
@caitlinelfring caitlinelfring deleted the no-ignore-inline branch March 6, 2021 17:53
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

Successfully merging this pull request may close these issues.

--no-ignore does not include inline ignored violations
2 participants