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

refactor: use black, flake8 and precommit #1395

Merged
merged 9 commits into from
Jun 27, 2023

Conversation

yungbender
Copy link

@yungbender yungbender commented Apr 6, 2023

I left the flake8 to be less stricter than new black setup, because otherwise the pipeline would fail with many errors (length of line errors), will make flake8 strict equal to black when we run all files with black.

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

@jira-linking
Copy link

jira-linking bot commented Apr 6, 2023

Referenced Jiras:
https://issues.redhat.com/browse/VULN-2714

@yungbender yungbender force-pushed the black_precommit branch 5 times, most recently from eeec3e7 to f157c81 Compare April 6, 2023 14:08
@codecov-commenter
Copy link

codecov-commenter commented Apr 6, 2023

Codecov Report

Patch coverage: 22.78% and no project coverage change.

Comparison is base (d58ce5a) 67.38% compared to head (03719df) 67.38%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1395   +/-   ##
=======================================
  Coverage   67.38%   67.38%           
=======================================
  Files          53       53           
  Lines        4998     4998           
=======================================
  Hits         3368     3368           
  Misses       1630     1630           
Impacted Files Coverage Δ
evaluator/evaluator.py 0.00% <0.00%> (ø)
evaluator/logic.py 0.00% <0.00%> (ø)
evaluator/processor.py 0.00% <0.00%> (ø)
listener/advisor_processor.py 0.00% <0.00%> (ø)
listener/inventory_processor.py 0.00% <0.00%> (ø)
listener/listener.py 0.00% <0.00%> (ø)
evaluator/common.py 100.00% <100.00%> (ø)
manager/filters.py 93.54% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mtclinton
Copy link
Contributor

/retest

1 similar comment
@yungbender
Copy link
Author

/retest

@yungbender
Copy link
Author

@psegedy @jdobes My fellow mac friends, could you check in your spare time on this and test it on your machines, if it also works there? thanks

Copy link
Member

@psegedy psegedy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run pre-commit run --all in gh action to force its usage and add to readme that everyone should setup pre-commit in their virtualenv. Something like:

## Setup pre-commit
cd vulnerability-engine
pipenv install --dev
pipenv shell
pre-commit install

.flake8 Show resolved Hide resolved
.flake8 Outdated Show resolved Hide resolved
.pre-commit-config.yaml Show resolved Hide resolved
listener/queue.py Outdated Show resolved Hide resolved
listener/queue.py Outdated Show resolved Hide resolved
.pre-commit-config.yaml Show resolved Hide resolved
@yungbender yungbender force-pushed the black_precommit branch 6 times, most recently from d353293 to 5010078 Compare June 26, 2023 14:14
@yungbender yungbender added skip-tests Skip iqe tests in pr_check skip-build Skip image build in pr_check skip-deploy Skip deployment to ephemeral in pr_check labels Jun 26, 2023
@yungbender yungbender force-pushed the black_precommit branch 4 times, most recently from d6feeb8 to 2207b18 Compare June 26, 2023 15:23
.pre-commit-config.yaml Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
run_tests.sh Outdated Show resolved Hide resolved
@yungbender yungbender force-pushed the black_precommit branch 2 times, most recently from 941fdda to 2cbd623 Compare June 27, 2023 09:22
@psegedy psegedy merged commit 4643572 into RedHatInsights:master Jun 27, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-build Skip image build in pr_check skip-deploy Skip deployment to ephemeral in pr_check skip-tests Skip iqe tests in pr_check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants