Skip to content

Commit 86bb9b5

Browse files
hackeddDavidy22
authored andcommitted
Add pre-commit config and apply all fixes
1 parent 96ef772 commit 86bb9b5

22 files changed

+94
-51
lines changed

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ For how to run the latest Guake in your computer, please refer to [Install from
1515

1616
Please use [FeatHub](https://feathub.com/Guake/guake) to fill-up a feature request.
1717

18-
This allow us to spot directly which are the most requested features.
19-
18+
This allows us to spot directly which are the most requested features.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ Please follow these steps before submitting a new Pull Request to Guake:
4141

4242
- Semantic commit is supported (and recommended). Add one of the following
4343
line in your commit messages:
44-
44+
4545
```
4646
# For a bug fix, uses:
4747
sem-ver: bugfix
48-
48+
4949
# For a new feature, uses:
5050
sem-ver: feature
51-
52-
# Please do not use the 'breaking change' syntax (`sem-ver: api-break`),
51+
52+
# Please do not use the 'breaking change' syntax (`sem-ver: api-break`),
5353
# it is reserved for really big reworks
5454
```

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
make test-actions
6161
# prepare for deployment
6262
make generate-paths
63-
63+
6464
- uses: Thog/action-equals@v1
6565
id: isLatest
6666
with:

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks.git
3+
rev: v4.3.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
args:
8+
- "--markdown-linebreak-ext=md"
9+
exclude: COPYING
10+
- repo: https://github.com/PyCQA/flake8.git
11+
rev: 3.9.2
12+
hooks:
13+
- id: flake8
14+
- repo: https://github.com/PyCQA/pylint.git
15+
rev: v2.13.6
16+
hooks:
17+
- id: pylint
18+
- repo: https://github.com/psf/black.git
19+
rev: 22.10.0
20+
hooks:
21+
- id: black
22+
- repo: https://github.com/hackedd/fiximports.git
23+
rev: 19bd841
24+
hooks:
25+
- id: fiximports

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
prune .github
2-
prune git-hooks
32
prune releasenotes
43
include guake *
54
prune guake/tests

Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ compile-glib-schemas-dev: clean-schemas
181181
clean-schemas:
182182
rm -f $(DEV_DATA_DIR)/gschemas.compiled
183183

184-
style: black
184+
style:
185+
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run pre-commit run --all-files
185186

186187
black:
187188
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run black $(MODULE)
@@ -312,15 +313,12 @@ freeze:
312313
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run pip freeze
313314

314315

315-
githook:
316-
bash git-hooks/post-commit
317-
318316
setup-githook:
319317
rm -f .git/hooks/post-commit
320-
cp -fv git-hooks/* .git/hooks/
318+
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run pre-commit install
321319

322320

323-
push: githook
321+
push:
324322
git push origin --tags
325323

326324

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pew = "*"
3434
black = "==21.8b0"
3535
flakehell = "*"
3636
toml = "*"
37+
pre-commit = "==2.17.0"
3738

3839
[packages]
3940
pbr = "*"

Pipfile.lock

Lines changed: 42 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/source/contributing/dev_env.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ You can reinstall easily in your environment (only validated for Debian/Ubuntu)
8484
Git hook
8585
========
8686

87-
Please install this git hook if you want to beautify your patch before submission:
87+
This project uses `pre-commit <https://pre-commit.com/>` to automatically execute some codestyle tools. It should be automatically installed by the ``make dev`` command, you can use ``make style`` if you want to run it manually. If you want to pass more options, you can use:
8888

8989
.. code-block:: bash
9090
91-
$ make setup-githook
91+
$ pipenv run pre-commit run --all-files

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Useful links
4545
- Source Code available on `GitHub <https://github.com/Guake/guake/>`_.
4646
- Official Homepage: http://guake-project.org
4747
- Online Documentation is hosted on `ReadTheDocs <http://guake.readthedocs.io/>`_.
48-
- If you are not a developer, you can still contribute to Guake by
48+
- If you are not a developer, you can still contribute to Guake by
4949
`improving its translations in your language <https://hosted.weblate.org/projects/guake/guake/>`_.
5050
Guake users are welcome `to support Weblate <https://weblate.org/donate/>`_ in providing this
5151
service for free for OpenSource Projects.

0 commit comments

Comments
 (0)