Skip to content

Commit 825b7d3

Browse files
committed
Add flake8 to pre-commit and add .flake8
ament_lint runs flake8 and flake8 and black are conflicting over " vs ' Signed-off-by: Alex Moriarty <[email protected]>
1 parent f0427d9 commit 825b7d3

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.flake8

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[flake8]
2+
max-line-length = 88
3+
4+
# Report all errors starting with E, F, W or C - or Bugbear's B590 rule, which is a "pragmatic" version of E501 (line too long)
5+
select = E,F,W,C,B590
6+
7+
# Ignore W503 - Line break occurred before a binary operator - because this error is introduced by Black formatter.
8+
# Ignore E203 - whitespace before ':' - because Black includes spaces in formatting slice expressions.
9+
# Ignore E501 - line too long - in favor of B590, which is more forgiving of long strings and comments that would be silly to break up.
10+
extend-ignore = W503, E203, E501

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ repos:
3636
hooks:
3737
- id: black
3838

39+
- repo: https://github.com/pycqa/flake8
40+
rev: 5.0.4
41+
hooks:
42+
- id: flake8
43+
# configured in .flake8 file
44+
3945
- repo: https://github.com/codespell-project/codespell
4046
rev: v2.2.5
4147
hooks:

0 commit comments

Comments
 (0)