Add linting
Change-Id: I2b5ee21c8fd1e23abc7beac164d17a07b17edcf5
This commit is contained in:
parent
074a1c18f3
commit
35fba1e707
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -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)
|
@ -9,8 +9,8 @@
|
||||
precedence: low
|
||||
require:
|
||||
gerrit:
|
||||
open: True
|
||||
current-patchset: True
|
||||
open: true
|
||||
current-patchset: true
|
||||
trigger:
|
||||
gerrit:
|
||||
- event: patchset-created
|
||||
@ -37,11 +37,11 @@
|
||||
manager: dependent
|
||||
precedence: normal
|
||||
supercedes: check
|
||||
post-review: True
|
||||
post-review: true
|
||||
require:
|
||||
gerrit:
|
||||
open: True
|
||||
current-patchset: True
|
||||
open: true
|
||||
current-patchset: true
|
||||
approval:
|
||||
- Workflow: 1
|
||||
trigger:
|
||||
@ -72,7 +72,7 @@
|
||||
log --format=%h) of the merge commit.
|
||||
manager: supercedent
|
||||
precedence: high
|
||||
post-review: True
|
||||
post-review: true
|
||||
trigger:
|
||||
gerrit:
|
||||
- event: ref-updated
|
||||
@ -88,7 +88,7 @@
|
||||
failure-message: Build failed (promote pipeline).
|
||||
manager: supercedent
|
||||
precedence: high
|
||||
post-review: True
|
||||
post-review: true
|
||||
trigger:
|
||||
gerrit:
|
||||
- event: change-merged
|
||||
@ -104,7 +104,7 @@
|
||||
that publish archives and documentation.
|
||||
manager: independent
|
||||
precedence: high
|
||||
post-review: True
|
||||
post-review: true
|
||||
trigger:
|
||||
gerrit:
|
||||
- event: ref-updated
|
||||
|
@ -2,7 +2,8 @@
|
||||
name: nebulous/project-config
|
||||
check:
|
||||
jobs:
|
||||
- noop
|
||||
- nox-linters:
|
||||
voting: false
|
||||
gate:
|
||||
jobs:
|
||||
- noop
|
||||
|
Loading…
x
Reference in New Issue
Block a user