[CI] Add nox linting
Change-Id: I2a9145031e41fe3d591a89dc2a67dcbcd02ba722
This commit is contained in:
parent
2180f468ba
commit
63db49f6b6
2
.gitignore
vendored
2
.gitignore
vendored
@ -0,0 +1,2 @@
|
|||||||
|
__pycache__/
|
||||||
|
.nox/
|
4
.yamllint
Normal file
4
.yamllint
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
extends: default
|
||||||
|
rules:
|
||||||
|
document-start: disable
|
||||||
|
line-length: disable
|
36
noxfile.py
Normal file
36
noxfile.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import nox
|
||||||
|
|
||||||
|
nox.options.error_on_external_run = True
|
||||||
|
nox.options.reuse_existing_virtualenvs = True
|
||||||
|
|
||||||
|
YAML_PATHS = [
|
||||||
|
"./zuul.d/",
|
||||||
|
]
|
||||||
|
|
||||||
|
PYTHON_PATHS = [
|
||||||
|
"./noxfile.py",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@nox.session
|
||||||
|
def black(session):
|
||||||
|
session.install("black")
|
||||||
|
session.run("black", *PYTHON_PATHS)
|
||||||
|
|
||||||
|
|
||||||
|
@nox.session
|
||||||
|
def isort(session):
|
||||||
|
session.install("isort")
|
||||||
|
session.run("isort", "--profile=black", *PYTHON_PATHS)
|
||||||
|
|
||||||
|
|
||||||
|
@nox.session
|
||||||
|
def linters(session):
|
||||||
|
session.install("yamllint")
|
||||||
|
session.install("black")
|
||||||
|
session.install("isort")
|
||||||
|
session.install("flake8")
|
||||||
|
session.run("yamllint", *YAML_PATHS)
|
||||||
|
session.run("black", "--check", *PYTHON_PATHS)
|
||||||
|
session.run("isort", "--profile=black", "--check", *PYTHON_PATHS)
|
||||||
|
session.run("flake8", *PYTHON_PATHS)
|
@ -2,9 +2,11 @@
|
|||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- nebulous-component-template-build-container-images
|
- nebulous-component-template-build-container-images
|
||||||
|
- nox-linters
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
- nebulous-component-template-upload-container-images
|
- nebulous-component-template-upload-container-images
|
||||||
|
- nox-linters
|
||||||
promote:
|
promote:
|
||||||
jobs:
|
jobs:
|
||||||
- nebulous-component-template-promote-container-images
|
- nebulous-component-template-promote-container-images
|
||||||
|
Loading…
x
Reference in New Issue
Block a user