-
Notifications
You must be signed in to change notification settings - Fork 0
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
Linting with flake8 #261
Merged
Merged
Linting with flake8 #261
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[flake8] | ||
extend-ignore = | ||
# Comparison to true should be 'if cond is true:' or 'if cond:' | ||
E712, | ||
# Comparison to None should be 'cond is None:' (E711) | ||
E711, | ||
# Line break occurred before a binary operator (W503) | ||
W503, | ||
# Missing whitespace after ',', ';', or ':' (E231) | ||
E231, | ||
# Line too long (82 > 79 characters) (E501) | ||
E501, | ||
# E251 unexpected spaces around keyword / parameter equals | ||
E251, | ||
# E502 the backslash is redundant between brackets | ||
E502, | ||
# E128 continuation line under-indented for visual indent | ||
E128, | ||
# E125 continuation line with same indent as next logical line | ||
E125, | ||
# E131 continuation line unaligned for hanging indent | ||
E131, | ||
# E129 visually indented line with same indent as next logical line | ||
E129, | ||
# Multiple spaces after ',' (E241) | ||
E241, | ||
E402, | ||
|
||
exclude = apps/mappings/apps.py, apps/xero/admin.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. assign back review once you fix this |
||
max-line-length = 99 | ||
max-complexity = 19 | ||
ban-relative-imports = true | ||
select = B,C,E,F,N,W,I25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
environment: CI Environment | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v2 | ||
- uses: satackey/[email protected] | ||
continue-on-error: true | ||
- name: Bring up Services and Run Tests | ||
|
@@ -32,4 +32,4 @@ jobs: | |
run: docker compose -f docker-compose-pipeline.yml down | ||
- name: Evaluate Coverage | ||
if: ${{ (env.STATUS == 'FAIL') || (env.FAILED > 0) }} | ||
run: exit 1 | ||
run: exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
default_stages: [commit] | ||
fail_fast: true | ||
exclude: ^(sql/|(.*\/)?migrations\/) | ||
default_language_version: | ||
python: python3 | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: check-ast | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/timothycrosley/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black", --trailing-comma, --line-length=125] | ||
|
||
- repo: https://github.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [flake8-isort, flake8-tidy-imports] | ||
|
||
- repo: https://github.com/Lucas-C/pre-commit-hooks-bandit | ||
rev: v1.0.5 | ||
hooks: | ||
- id: python-bandit-vulnerability-check | ||
args: [ -lll, --recursive, -c, bandit.yaml, .] | ||
files: .py$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we excluding these two files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they had imports like signal, django.contrib.admin which are needed but it was giving unused error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore those lines only by adding a comment in the previous line, don't ignore the whole file