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
Commits
09619e7d
Commit
09619e7d
authored
1 year ago
by
Iñigo Moreno i Caireta
Browse files
Options
Downloads
Patches
Plain Diff
Extend flake8 to all files with a python shebang
parent
9e280897
No related branches found
Branches containing commit
No related tags found
1 merge request
!96
Resolve "Flake8 not running for files with pyhton shebang but no py extension"
Pipeline
#142754
failed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci-templates/python.yml
+5
-3
5 additions, 3 deletions
ci-templates/python.yml
with
5 additions
and
3 deletions
ci-templates/python.yml
+
5
−
3
View file @
09619e7d
...
...
@@ -2,14 +2,16 @@
.flake8_template
:
stage
:
build
before_script
:
${PYTHON_VERSION} -m pip -q install flake8
script
:
${PYTHON_VERSION} -m flake8 --max-line-length 120 --statistics --show-source .
script
:
-
find . -type f -executable -exec awk ' /^#!.*python/{print FILENAME} {nextfile}' {} + > /tmp/shebang_python_files
-
find . -type f -name "*.py" > /tmp/extension_python_files
-
sort /tmp/extension_python_files /tmp/shebang_python_files | uniq | xargs ${PYTHON_VERSION} -m flake8 --max-line-length 120 --statistics --show-source
.flake8_extended_template
:
extends
:
.flake8_template
stage
:
.post
before_script
:
-
${PYTHON_VERSION} -m pip install flake8 flake8-isort flake8-builtins flake8-eradicate flake8-functions-names flake8-return flake8-functions
script
:
${PYTHON_VERSION} -m flake8 --max-line-length 120 --statistics --show-source .
allow_failure
:
true
.security_template
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment