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

[Explain] Ignore blank lines as crowdsec will anyways #2630

Merged

Conversation

LaurenceJJones
Copy link
Contributor

@LaurenceJJones LaurenceJJones commented Nov 30, 2023

Fix #2610

Add check on stdin for zero length lines.

Expand line checker on files to ignore zero length lines.

Return error if tmp file or target file has no content.

Edit:

Add defer function to cleanup as if we returned early the temporary files were kept.

Copy link

@LaurenceJJones: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

Copy link

@LaurenceJJones: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@LaurenceJJones
Copy link
Contributor Author

/kind enhancement
/area cscli

@LaurenceJJones LaurenceJJones changed the title [Explain] Check blank lines [Explain] Ingore blank lines as crowdsec will anyways Nov 30, 2023
@LaurenceJJones LaurenceJJones changed the title [Explain] Ingore blank lines as crowdsec will anyways [Explain] Ignore blank lines as crowdsec will anyways Nov 30, 2023
Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Attention: 37 lines in your changes are missing coverage. Please review.

Comparison is base (7e5ab34) 58.22% compared to head (afb18b3) 58.18%.

Files Patch % Lines
cmd/crowdsec-cli/explain.go 35.08% 28 Missing and 9 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2630      +/-   ##
==========================================
- Coverage   58.22%   58.18%   -0.05%     
==========================================
  Files         201      201              
  Lines       27048    27077      +29     
==========================================
+ Hits        15750    15754       +4     
- Misses       9753     9772      +19     
- Partials     1545     1551       +6     
Flag Coverage Δ
bats 38.35% <35.08%> (-0.05%) ⬇️
unit-linux 55.24% <ø> (+0.01%) ⬆️
unit-windows 51.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

cmd/crowdsec-cli/explain.go Outdated Show resolved Hide resolved
@LaurenceJJones LaurenceJJones merged commit bfc92ca into crowdsecurity:master Dec 4, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cscli kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: runtime error: index out of range [-1]
4 participants