mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add a .jenkins file to run pylint
This commit is contained in:
parent
2529292568
commit
e594979745
1 changed files with 36 additions and 0 deletions
36
.jenkins/lint
Normal file
36
.jenkins/lint
Normal file
|
@ -0,0 +1,36 @@
|
|||
pipeline {
|
||||
agent { label 'lint' }
|
||||
environment {
|
||||
PYENV_ROOT = "/usr/local/pyenv"
|
||||
PATH = "$PYENV_ROOT/bin:$PATH"
|
||||
}
|
||||
stages {
|
||||
stage('pylint setup') {
|
||||
steps {
|
||||
sh 'eval "$(pyenv init -)"; pyenv install 2.7.14 || echo "We already have this python."; pyenv local 2.7.14; pyenv shell 2.7.14'
|
||||
sh 'eval "$(pyenv init -)"; pip install pylint SaltPyLint'
|
||||
sh 'eval "$(pyenv init -)"; which pylint; pylint --version'
|
||||
}
|
||||
}
|
||||
stage('salt linting') {
|
||||
steps {
|
||||
sh 'eval "$(pyenv init -)"; pylint --rcfile=.testing.pylintrc --disable=W1307,str-format-in-logging setup.py salt/modules/nix.py | tee pylint-report.xml'
|
||||
archiveArtifacts artifacts: 'pylint-report.xml'
|
||||
}
|
||||
}
|
||||
stage('test linting') {
|
||||
steps {
|
||||
sh 'eval "$(pyenv init -)"; pylint --rcfile=.testing.pylintrc --disable=W0232,E1002,W1307,str-format-in-logging salt/modules/nix.py | tee pylint-report-tests.xml'
|
||||
archiveArtifacts artifacts: 'pylint-report-tests.xml'
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
githubNotify description: "The lint job has passed", status: "SUCCESS"
|
||||
}
|
||||
failure {
|
||||
githubNotify description: "The lint job has failed", status: "FAILURE"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue