Skip to content

Commit ca217d2

Browse files
committed
[py]: Exit 1 in ci when linter is failing
1 parent c09027b commit ca217d2

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.github/workflows/ci-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Test with tox
3939
run: tox -c py/tox.ini
4040
env:
41-
TOXENV: linting
41+
TOXENV: linting-check
4242

4343
tox_docs:
4444
if: ${{ needs.check_workflow.outputs.result == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(toJson(github.event.commits), '[run python]') == true }}

py/tox.ini

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ py_version=37
3030
force_single_line = True
3131

3232

33+
[testenv:linting-check]
34+
; checks linting for CI with stricter exiting when failing.
35+
skip_install = true
36+
deps =
37+
isort==5.10.1
38+
black==22.8.0
39+
flake8==5.0.4
40+
flake8-typing-imports==1.13.0
41+
commands =
42+
; execute isort in check only mode.
43+
isort --check-only --diff selenium/ test/
44+
; execute black in check only mode with diff.
45+
black --check --diff test/ selenium/common/ selenium/webdriver/safari -l 120
46+
flake8 selenium/ test/ --min-python-version=3.7
47+
3348
[testenv:linting]
3449
; A consolidated linting based recipe, responsible for executing linting tools across the code base.
3550
; This encompasses isort for imports, black for general formatting and flake8.

0 commit comments

Comments
 (0)