Skip to content

Commit 6930f2b

Browse files
committed
Use also Flake8
1 parent aa2c3a8 commit 6930f2b

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

Diff for: .flake8

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
exclude =
3+
__pycache__,
4+
ignore = E501

Diff for: CONTRIBUTING.rst

+14-2
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,22 @@ needed in internal code. When docstrings are added, they should follow
107107
`PEP-257`_. See `Documentation`_ section below for more details about
108108
documentation syntax, generating docs, etc.
109109

110-
The code should be formatted with `Black`_ and black can be run by using
110+
The code should be formatted with `Black`_ and errors found by `flake8`_
111+
should be fixed. Black and flake8 can be run by using
111112
command::
112113

113114
inv lint
114115

116+
By default flake8 ignores line length error E501, but it does not ignore
117+
warning W503. In practice Black formats list access like this::
118+
119+
list[1 : 2]
120+
121+
But flake8 will display an warning about it. This should be manually
122+
fixed to look like::
123+
124+
list[1:2]
125+
115126
Documentation
116127
-------------
117128

@@ -215,4 +226,5 @@ the same code as your changes. In that case you should
215226
.. _test/README.rst`: https://github.com/robotframework/SeleniumLibrary/blob/master/test/README.rst
216227
.. _sync your fork: https://help.github.com/articles/syncing-a-fork/
217228
.. _resolve conflicts: https://help.github.com/articles/resolving-a-merge-conflict-from-the-command-line
218-
.. _Black: https://github.com/psf/black
229+
.. _Black: https://github.com/psf/black
230+
.. _flake8: https://gitlab.com/pycqa/flake8

Diff for: tasks.py

+1
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,4 @@ def init_labels(ctx, username=None, password=None):
151151
@task
152152
def lint(ctx):
153153
ctx.run("black --config pyproject.toml src/ utest/ atest/")
154+
ctx.run("flake8 --config .flake8 src/ utest/ atest/")

0 commit comments

Comments
 (0)