Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GWDataFind Client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IGWN Computing and Software
GWDataFind
GWDataFind Client
Merge requests
!69
Improvements to code quality analysis in CI
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Improvements to code quality analysis in CI
duncanmmacleod/gwdatafind:ci-improvements
into
main
Overview
0
Commits
3
Pipelines
4
Changes
2
Merged
Duncan Macleod
requested to merge
duncanmmacleod/gwdatafind:ci-improvements
into
main
3 years ago
Overview
0
Commits
3
Pipelines
4
Changes
2
Expand
This MR makes a few changes ('improvements') to the code quality analysis in the CI:
always pass flake8, rely on the code quality report in the merge request UI
improve parsing of requirements for flake8
add dependency_scanning job
0
0
Merge request reports
Compare
main
version 2
4f7f2681
3 years ago
version 1
0f6f8bc6
3 years ago
main (base)
and
latest version
latest version
6c728217
3 commits,
3 years ago
version 2
4f7f2681
2 commits,
3 years ago
version 1
0f6f8bc6
2 commits,
3 years ago
2 files
+
38
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
.gitlab/ci/analysis.yml
+
36
−
8
Options
@@ -8,6 +8,8 @@ include:
file
:
# https://computing.docs.ligo.org/gitlab-ci-templates/python/
-
python.yml
# https://docs.gitlab.com/ee/user/application_security/dependency_scanning/
-
template
:
Security/Dependency-Scanning.gitlab-ci.yml
# -- code quality -----------
#
@@ -21,15 +23,41 @@ flake8:
# https://computing.docs.ligo.org/gitlab-ci-templates/python/#.python:flake8
-
.python:flake8
needs
:
[]
variables
:
# don't fail the pipeline because of linting issues,
# these are presented in the code-quality box in the
# merge_request UI
FLAKE8_OPTIONS
:
"
--exit-zero"
before_script
:
# pick requirements out of the
s
et
up.cfg
# pick requirements out of the
m
et
adata
-
|
REQUIREMENTS=$(python -c "
from configparser import ConfigParser;
cp = ConfigParser();
cp.read('setup.cfg');
print(cp['options.extras_require']['lint'].strip())")
REQUIREMENTS=$(${PYTHON} -c "
from setuptools import Distribution
dist = Distribution()
dist.parse_config_files()
for req in dist.extras_require['lint']:
print(req)
")
# install things
-
!reference
[
"
.python:flake8"
,
before_script
]
# code quality issues should present a global 'warning'
allow_failure
:
true
# -- dependency scanning ----
#
# This job checks for dependency
# issues
#
dependency_scanning
:
stage
:
Code quality
needs
:
[]
before_script
:
-
|
python -c "
from setuptools import Distribution
dist = Distribution()
dist.parse_config_files()
reqs = dist.setup_requires + dist.install_requires
for extra in ('test',):
reqs.extend(dist.extras_require[extra])
print('\n'.join(reqs))
" | sort -u > requirements.txt
Loading