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

Bug: fix running stdin #86

Merged
merged 3 commits into from
Jun 20, 2021
Merged

Bug: fix running stdin #86

merged 3 commits into from
Jun 20, 2021

Conversation

caitlinelfring
Copy link
Member

@caitlinelfring caitlinelfring commented Jun 20, 2021

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 for stdin, which stopped working on v0.8.1.

What is the current behavior? (You can also link to an open issue here)
Fixes #85

What is the new behavior (if this is a feature change)?
Previous behavior:

$ echo "whitelist" | go run main.go --stdin
No violations found. Stay woke ✊

New behavior:

$ echo "whitelist" | go run main.go --stdin
/dev/stdin:1:0-9: `whitelist` may be insensitive, use `allowlist`, `inclusion list` instead (warning)
whitelist
^

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

Other information:

stdin stopped working in v0.8.1, related to changes in #78 which checked if the file is a text file in a different place. It was causing IsTextFileFromFilename to open stdin, which it saw as an empty file and would ignore it.

@codecov
Copy link

codecov bot commented Jun 20, 2021

Codecov Report

Merging #86 (bbe3537) into main (e0c7d98) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #86      +/-   ##
==========================================
+ Coverage   95.58%   95.60%   +0.01%     
==========================================
  Files          21       21              
  Lines         476      478       +2     
==========================================
+ Hits          455      457       +2     
  Misses         12       12              
  Partials        9        9              
Impacted Files Coverage Δ
pkg/util/contenttype.go 100.00% <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 e0c7d98...bbe3537. Read the comment docs.

@caitlinelfring caitlinelfring merged commit 0dc3fe3 into main Jun 20, 2021
@caitlinelfring caitlinelfring deleted the fix-85 branch June 20, 2021 17:55
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.

--stdin not working?
1 participant