Documented commands run with all-repos
for doing mass rewrites.
https://changelog.travis-ci.com/the-default-python-version-for-your-builds-is-now-3-6-97935
all-repos-sed \
--commit-msg 'python3.6 is the default in travis now' \
--branch-name travis-python36 \
'/^python: 3.6$/d' .travis.yml
This applies the following diff:
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,4 @@
language: python
-python: 3.6
install: pip install pre-commit
script: pre-commit run --all-files
cache:
https://blog.travis-ci.com/2017-07-11-trusty-as-default-linux-is-coming
all-repos-sed '/^dist: trusty/d' .travis.yml \
--commit-msg 'Remove noop `dist: trusty` from travis.yml'
This applies the following diff:
diff --git a/.travis.yml b/.travis.yml
index 1365a38..960612f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,4 @@
language: python
-dist: trusty
matrix:
include:
- python: pypy2.7-5.10.0
https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration
all-repos-sed '/sudo:/d' .travis.yml \
--commit-msg "$(echo -e 'remove sudo: in .travis.yml\n\nhttps://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration')"
This applies the following diff
diff --git a/.travis.yml b/.travis.yml
index c42db4e..b5b10e5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,4 @@
language: python
-sudo: false
matrix:
include: # These should match the tox env list
- env: TOXENV=py27
all-repos-sed 's/36/37/g' appveyor.yml \
--commit-msg 'Use python3.7 in appveyor'
This applies the following diff
diff --git a/appveyor.yml b/appveyor.yml
index 8df64a5..395320b 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,10 +1,10 @@
environment:
matrix:
- TOXENV: py27
- - TOXENV: py36
+ - TOXENV: py37
install:
- - "SET PATH=C:\\Python36;C:\\Python36\\Scripts;%PATH%"
+ - "SET PATH=C:\\Python37;C:\\Python37\\Scripts;%PATH%"
- pip install tox
# Not a C# project
all-repos-sed 's|sha:|rev:|g;s|sha you want|sha / tag you want|g' README.md \
--commit-msg 'Replace sha: with rev: in documentation'
This applies the following diff
--- a/README.md
+++ b/README.md
@@ -12,6 +12,6 @@ For scss-lint: see https://github.com/causes/scss-lint
Add this to your `.pre-commit-config.yaml`:
- repo: https://github.com/pre-commit/mirrors-scss-lint
- sha: '' # Use the sha you want to point at
+ rev: '' # Use the sha / tag you want to point at
hooks:
- id: scss-lint
sha
is soft deprecated for rev
all-repos-sed 's/E309,//g' tox.ini \
--commit-msg 'E309 is no longer rewritten by autopep8'
This applies the following diff
--- a/tox.ini
+++ b/tox.ini
@@ -21,4 +21,4 @@ commands =
max-line-length=131
[pep8]
-ignore=E265,E309,E501
+ignore=E265,E501
E309 was removed here.
all-repos-grep --repos -- show-missing -- tox.ini |
xargs --replace grep -l show_missing {}/.coveragerc |
cut -d'/' -f1-3 |
xargs all-repos-sed 's/ --show-missing//g' tox.ini \
--commit-msg 'Remove --show-missing when it is set in .coveragerc' \
--branch-name show-missing \
--repos
When the [report]
section of .coveragerc
already contains
show_missing = True
, it is redundant to call
coverage report --show-missing
.
Here is a sample pr.
all-repos-sed \
's/\[wheel\]/[bdist_wheel]/g' setup.cfg \
--commit-msg 'Replace legacy wheel metadata'
This applies the following diff:
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,2 +1,2 @@
-[wheel]
+[bdist_wheel]
universal = True
The [wheel]
format is considered legacy.
Here is a sample pr.
all-repos-grep '@.*\.route('
I was looking for @app.route('/<path:path_var>')
all-repos-sed \
's|\.git$||g;s|git://|https://|g;s|git@github.com:|https://github.com/|g' .pre-commit-config.yaml \
--interactive \
--commit-msg "$(echo -en 'Normalize git urls in pre-commit config\n\nImproves cache performance')" \
--repos $(all-repos-grep --repos -E '(git@|git://|\.git)' -- .pre-commit-config.yaml)
This normalizes git urls in .pre-commit-config.yaml
to https://
urls.
Normalizations:
- Remove unnecessary trailing
.git
git://
tohttps://
git@github.com:
tohttps://
Normalization away from ssh urls is done for a few reasons:
ssh
credentials are not available on travis-ci.SSH_AUTH_SOCK
is not passed through when runningtox
.
Here is a sample pr.