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

Use null terminator for masking inline ignore #111

Merged
merged 3 commits into from
Jul 22, 2021
Merged

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)
Use the unicode.ReplacementChar � to mask any inline ignores so they don't result in a "finding". This is actually a three byte symbol and causes the matcher to return incorrect and out of bound indexes

What is the new behavior (if this is a feature change)?
Switch to using a single byte character to mask inline ignores (null terminator - http://en.wikipedia.org/wiki/Null_character). The goal is to use something that wouldn't trigger any findings

Does this PR introduce a breaking change? (What changes might users need to make due to this PR?)
No

Other information:
Fixes #109

@codecov
Copy link

codecov bot commented Jul 22, 2021

Codecov Report

Merging #111 (76b974a) into main (4c46b2f) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 76b974a differs from pull request most recent head 93b586d. Consider uploading reports for the commit 93b586d to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main     #111   +/-   ##
=======================================
  Coverage   96.22%   96.22%           
=======================================
  Files          20       20           
  Lines         583      583           
=======================================
  Hits          561      561           
  Misses         13       13           
  Partials        9        9           
Impacted Files Coverage Δ
pkg/rule/rule.go 93.75% <100.00%> (ø)

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 4c46b2f...93b586d. Read the comment docs.

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.

woke panics if a wokeignore comment is at the start of a line.
1 participant