Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d273061

Browse files
authored
CONTRIBUTING.rst: Default branch is develop, add pre-commit (#349)
1 parent d0456bd commit d273061

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

CONTRIBUTING.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ Alternatively, you can locally install patches like this::
3636
pip install -e .[dev]
3737
# for usage without virtualenv, add --user
3838

39+
Please install pre-commit locally to run the linters before committing::
40+
41+
pipx install pre-commit
42+
pre-commit install
43+
3944
Pull requests
4045
-------------
4146

@@ -66,9 +71,9 @@ You can test your changes under your local python environment by running the tes
6671
pytest
6772
# lint the code
6873
pylint cpplint.py
69-
flake8
74+
pre-commit run --all-files
7075
71-
Alternatively, you can run `tox` to automatically run all tests and lints. Use `-e ` followed by the python runner and version (which you must have installed) to automatically generate the testing environment and run the above tests and lints in it. For example, `tox -e py39` does the steps in Python 3.9, `tox -e py312` does the steps in Python 3.12, and `tox -e pypy3` does the steps using the latest version of the pypy interpreter.
76+
Alternatively, you can run `tox` to automatically run all tests and lints. Use `-e ` followed by the python runner and version (which you must have installed) to automatically generate the testing environment and run the above tests and lints in it. For example, `tox -e py39` does the steps in Python 3.9, `tox -e py313` does the steps in Python 3.13, and `tox -e pypy3` does the steps using the latest version of the pypy interpreter.
7277

7378
Releasing
7479
=========
@@ -116,14 +121,14 @@ To incorporate google's changes:
116121
git fetch google gh-pages
117122
118123
## Merge workflow (clean, no new commits)
119-
git checkout master -b updates
124+
git checkout develop -b updates
120125
git merge google/gh-pages # this will have a lot of conflicts
121126
# ... solve conflicts
122127
git merge -- continue
123128
124129
## Rebase workflow (dirty, creates new commits)
125130
git checkout -b updates FETCH_HEAD
126-
git rebase master # this will have a lot of conflicts, most of which can be solved with the next command (run repeatedly)
131+
git rebase develop # this will have a lot of conflicts, most of which can be solved with the next command (run repeatedly)
127132
# solve conflicts with files deleted in our fork (this is idempotent and safe to be called. when cpplint.py has conflicts, it will do nothing)
128133
git status | grep 'new file:' | awk '{print $3}' | xargs -r git rm --cached ; git status | grep 'deleted by us' | awk '{print $4}' | xargs -r git rm
129134
git status --untracked-files=no | grep 'nothing to commit' && git rebase --skip
@@ -132,7 +137,7 @@ To incorporate google's changes:
132137
# check github action
133138
git push origin --delete updates
134139
135-
git rebase updates master
140+
git rebase updates develop
136141
git branch -D updates
137142
git push
138143
@@ -156,5 +161,5 @@ To compare this for with upstream (after git fetch):
156161

157162
.. code-block:: bash
158163
159-
git diff google/gh-pages:cpplint/cpplint.py master:cpplint.py
160-
git diff google/gh-pages:cpplint/cpplint_unittest.py master:cpplint_unittest.py
164+
git diff google/gh-pages:cpplint/cpplint.py develop:cpplint.py
165+
git diff google/gh-pages:cpplint/cpplint_unittest.py develop:cpplint_unittest.py

0 commit comments

Comments
 (0)