Start upgrading codebase to Py3 for every changed file

This commit is contained in:
Pedro Algarvio 2020-07-14 10:13:16 +01:00 committed by Daniel Wozniak
parent 1f70709318
commit cf391a2cdf
5 changed files with 34 additions and 4 deletions

View file

@ -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

View file

@ -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:

View file

@ -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,

View file

@ -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

View file

@ -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.