Skip to content
Snippets Groups Projects
Commit 704de5ad authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-310: Extend linting with breakpoint, mock and shell checks

Adds missing newline eof detection in common file formats as well
as finding breakpoint and debugger statements, non-existing mock
statements and adding shellcheck for our shell scripts.
parent d2d3a40f
Branches
Tags
1 merge request!128L2SS-310: Extend linting with breakpoint, mock and shell checks
...@@ -16,17 +16,30 @@ stages: ...@@ -16,17 +16,30 @@ stages:
- static-analysis - static-analysis
- unit-tests - unit-tests
- integration-tests - integration-tests
linting: newline_at_eof:
stage: linting
before_script:
- pip3 install -r devices/test-requirements.txt
script:
- flake8 --filename *.sh,*.conf,*.md,*.yml --select=W292 --exclude .tox,.egg-info,docker
python_linting:
stage: linting stage: linting
script: script:
- cd devices - cd devices
- tox -e pep8 - tox -e pep8
static-analysis: bandit:
stage: static-analysis stage: static-analysis
allow_failure: true
script: script:
- cd devices - cd devices
- tox -e bandit - tox -e bandit
shellcheck:
stage: static-analysis
allow_failure: true
before_script:
- sudo apt-get update
- sudo apt-get install -y shellcheck
script:
- shellheck **/*.sh
unit_test: unit_test:
stage: unit-tests stage: unit-tests
before_script: before_script:
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
doc8>=0.8.0 # Apache-2.0 doc8>=0.8.0 # Apache-2.0
flake8>=3.8.0 # MIT flake8>=3.8.0 # MIT
flake8-breakpoint>=1.1.0 # MIT
flake8-debugger>=4.0.0 #MIT
flake8-mock>=0.3 #GPL
bandit>=1.6.0 # Apache-2.0 bandit>=1.6.0 # Apache-2.0
hacking>=3.2.0,<3.3.0 # Apache-2.0 hacking>=3.2.0,<3.3.0 # Apache-2.0
coverage>=5.2.0 # Apache-2.0 coverage>=5.2.0 # Apache-2.0
......
...@@ -42,5 +42,5 @@ commands = ...@@ -42,5 +42,5 @@ commands =
[flake8] [flake8]
filename = *.py,.stestr.conf,.txt filename = *.py,.stestr.conf,.txt
select = W292 select = W292,B601,B602,T100,M001
exclude=.tox,.egg-info exclude=.tox,.egg-info
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment