Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
templates
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tecnalia_robotics-public
templates
Merge requests
!80
Resolve "python_syntax is python2 only"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "python_syntax is python2 only"
48-python_syntax-is-python2-only
into
master
Overview
40
Commits
12
Pipelines
13
Changes
1
Merged
Jon Azpiazu
requested to merge
48-python_syntax-is-python2-only
into
master
2 years ago
Overview
40
Commits
12
Pipelines
13
Changes
1
Expand
Closes
#48 (closed)
Edited
2 years ago
by
Jon Azpiazu
0
0
Merge request reports
Viewing commit
470bc229
Prev
Next
Show latest version
1 file
+
36
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
470bc229
New jobs to substitute the old Python check
· 470bc229
Jon Azpiazu
authored
2 years ago
ci-templates/syntax-check.yml
+
36
−
9
Options
@@ -16,16 +16,43 @@ clang_format:
when
:
always
##########################################################
## Simple check for basic Python syntax errors; this is much less thorough than
## other options like pylint, but much faster and less strict
## Several Python checks
##########################################################
python_syntax
:
image
:
alpine:3.15
# python2 is no longer available in alpine:3.16
before_script
:
-
apk add --update python2
stage
:
build
script
:
python -m compileall -q .
when
:
always
flake8
:
stage
:
.post
image
:
python:3-alpine
before_script
:
-
pip3 install flake8
script
:
-
flake8 --max-line-length 120 --statistics --show-source .
tags
:
-
docker
when
:
always
flake8_extended
:
stage
:
.post
image
:
python:3-alpine
before_script
:
-
pip3 install flake8 flake8-isort flake8-builtins flake8-eradicate flake8-functions-names flake8-return flake8-functions
script
:
-
flake8 --max-line-length 120 --statistics --show-source .
tags
:
-
docker
when
:
always
allow_failure
:
true
python_security
:
stage
:
.post
image
:
python:3-alpine
before_script
:
-
pip3 install bandit safety
script
:
-
bandit -r . || RET=1
-
safety check || RET=1
-
exit $RET
tags
:
-
docker
when
:
always
##########################################################
## Check for errors in bash/sh scripts
Loading