-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add various lint check in pre-commit and Nox sessions (#22)
To ensure code formatting consistencies and identify early potential bug or security issues. Participate to #18 * Add pre-commit in dev dependencies * Migrate lint check in pre-commit It will allow to use the pre-commit hook in the future. * Fix typo in documentation * Add pre-commit-hooks in dev dependencies * Add balck in dev dependencies * Add black in pre-commit conf * Add black in lint Nox session * Add pre-commit-hooks checks * Fix end of files * Add reorder_python_imports in dev dependencies * Add reorder-python-imports check * Reorder all imports with nox * Add flake8-bugbear in dev dependencies * Add flake8-bugbear in pre-commit nox session * Add flake8-bandit in dev dependencies * Add flake8-bandit in pre-commit nox session * Add safety in dev dependencies * Add safety in nox sessions * Add pep8-naming in dev dependencies * Add pep8-naming check in pre-commit nox session * Remove old lint session in Nox * Add prettier in pre-commit config * Change var variable name to be compliant with pep8 R -> radius * Fix formatting by prettier * Update contributing documentation about pre-commit
- Loading branch information
1 parent
89d9d30
commit 09eabbb
Showing
23 changed files
with
815 additions
and
102 deletions.
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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
[flake8] | ||
select = C,D,E,F,W | ||
select = B,B9,C,D,E,F,N,S,W | ||
max-complexity = 10 | ||
docstring-convention = google | ||
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build,.eggs | ||
max-line-length = 80 | ||
|
||
# To work with Black | ||
max-line-length = 88 | ||
# E501: line too long | ||
# W503: Line break occurred before a binary operator | ||
# E501: line too long => covered by B950 | ||
# W503: Line break occurred before a binary operator => Disabled for Black compatibility | ||
# E203: Whitespace before ':' | ||
# D202 No blank lines allowed after function docstring | ||
# W504 line break after binary operator | ||
ignore = W503 | ||
# E501, | ||
ignore = W503, E501 | ||
# E203, | ||
# D202, | ||
# W504 | ||
|
||
# For avoiding issue with bandit | ||
per-file-ignores = tests/*:S101 |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
--- | ||
name: Issue | ||
about: Create a report to help us improve | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**log** | ||
|
||
``` | ||
Add your logs here. | ||
``` | ||
``` |
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 |
---|---|---|
|
@@ -129,4 +129,4 @@ dmypy.json | |
.pyre/ | ||
|
||
# Editor | ||
/.vscode | ||
/.vscode |
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,51 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: black | ||
name: black | ||
entry: black | ||
language: system | ||
types: [python] | ||
require_serial: true | ||
- id: flake8 | ||
name: flake8 | ||
entry: flake8 | ||
language: system | ||
types: [python] | ||
require_serial: true | ||
- id: check-added-large-files | ||
name: Check for added large files | ||
entry: check-added-large-files | ||
language: system | ||
- id: check-toml | ||
name: Check Toml | ||
entry: check-toml | ||
language: system | ||
types: [toml] | ||
- id: check-yaml | ||
name: Check Yaml | ||
entry: check-yaml | ||
language: system | ||
types: [yaml] | ||
- id: end-of-file-fixer | ||
name: Fix End of Files | ||
entry: end-of-file-fixer | ||
language: system | ||
types: [text] | ||
stages: [commit, push, manual] | ||
- id: trailing-whitespace | ||
name: Trim Trailing Whitespace | ||
entry: trailing-whitespace-fixer | ||
language: system | ||
types: [text] | ||
stages: [commit, push, manual] | ||
- id: reorder-python-imports | ||
name: Reorder python imports | ||
entry: reorder-python-imports | ||
language: system | ||
types: [python] | ||
args: [--application-directories=src] | ||
- repo: https://github.com/prettier/prettier | ||
rev: 2.0.5 | ||
hooks: | ||
- id: prettier |
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.