Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .ci/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
@Library('salt@master-1.7') _

if (env.CHANGE_ID) {
// This is a PR
pre_commit_skips = ''
} else {
// This is a branch build
pre_commit_skips = 'pyupgrade'
}

runPreCommit(
env: env)
env: env,
pre_commit_skips: pre_commit_skips)

// vim: ft=groovy
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,19 @@ repos:
- --py-version=3.9
# <---- Invoke -----------------------------------------------------------------------------------------------------

- repo: https://github.com/asottile/pyupgrade
# This, for now, is meant to run when locally committing code and will be disabled(skipped) when we run pre-commit
# against all codebase to avoid MASSIVE code churn. This way, we do it in smaller chunks, a few at a time.
rev: v2.7.2
hooks:
- id: pyupgrade
name: Drop six usage and Py2 support
args: [--py3-plus, --keep-mock]
exclude: >
(?x)^(
salt/client/ssh/ssh_py_shim.py
)$

- repo: https://github.com/timothycrosley/isort
rev: "1e78a9acf3110e1f9721feb591f89a451fc9876a"
hooks:
Expand Down
1 change: 0 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ limit-inference-results=100
# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins=saltpylint.pep8,
saltpylint.pep263,
saltpylint.strings,
saltpylint.fileperms,
saltpylint.py3modernize,
Expand Down
11 changes: 10 additions & 1 deletion cicd/jenkins/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
@Library('salt@master-1.7') _

if (env.CHANGE_ID) {
// This is a PR
pre_commit_skips = ''
} else {
// This is a branch build
pre_commit_skips = 'pyupgrade'
}

runPreCommit(
env: env)
env: env,
pre_commit_skips: pre_commit_skips)

// vim: ft=groovy
2 changes: 1 addition & 1 deletion salt/client/ssh/ssh_py_shim.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylint: disable=no-encoding-in-file,resource-leakage
# pylint: disable=resource-leakage
"""
This is a shim that handles checking and updating salt thin and
then invoking thin.
Expand Down