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.

git-hooks/post-commit

Lines changed: 0 additions & 18 deletions
This file was deleted.

guake/callbacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
from gi.repository import Gtk
66
from guake.about import AboutDialog
77
from guake.dialogs import SaveTerminalDialog
8+
from guake.globals import ENGINES
89
from guake.prefs import PrefsDialog
910
from guake.utils import FullscreenManager
1011
from guake.utils import HidePrevention
1112
from guake.utils import get_server_time
12-
from guake.globals import ENGINES
1313
from urllib.parse import quote_plus
1414

1515

guake/data/guake.desktop.metainfo.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
<description>
1010
<p>
1111
Guake is a top-down terminal for Gnome, and is highly inspired by the famous terminal used in Quake.
12-
You can instantaneously show and hide your terminal with a single key stroke, execute a command, and then go back to your previous task without breaking your workflow.
12+
You can instantaneously show and hide your terminal with a single key stroke, execute a command, and then go back to your previous task without breaking your workflow.
1313
</p>
1414
<p>
1515
Imagine you are working in your favorite text editor and want to execute some commands, like execute the unit test of your code, check a man page, or edit some configuration file.
1616
You can do it at lightning speed without leaving your keyboard.
17-
Just press your predefined "Show Guake" hotkey, execute your command, and press it again to hide the terminal and go back to your work.
17+
Just press your predefined "Show Guake" hotkey, execute your command, and press it again to hide the terminal and go back to your work.
1818
</p>
1919
</description>
2020

@@ -33,4 +33,3 @@
3333
<url type="bugtracker">https://github.com/Guake/guake/issues</url>
3434
<url type="translate">https://hosted.weblate.org/projects/guake/guake/</url>
3535
</component>
36-

guake/keybindings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import gi
2525

2626
gi.require_version("Gtk", "3.0")
27-
from gi.repository import Gtk
2827
from gi.repository import Gdk
28+
from gi.repository import Gtk
2929

3030
from guake import notifier
3131
from guake.common import pixmapfile

guake/prefs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
from guake.globals import ALIGN_RIGHT
4646
from guake.globals import ALIGN_TOP
4747
from guake.globals import ALWAYS_ON_PRIMARY
48+
from guake.globals import ENGINES
4849
from guake.globals import MAX_TRANSPARENCY
4950
from guake.globals import NAME
5051
from guake.globals import QUICK_OPEN_MATCHERS
51-
from guake.globals import ENGINES
5252
from guake.palettes import PALETTES
5353
from guake.paths import AUTOSTART_FOLDER
5454
from guake.paths import LOCALE_DIR

releasenotes/notes/[Add_open_link_under_terminal_cursor_accelerator]-6bd83e590f8403d9.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ release_summary: >
44
features:
55
- |
66
- Add new accelerator to open a link or URL under the terminal cursor #2060
7-

releasenotes/notes/bugfix-bfcece2fed005b98.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ release_summary: >
44
fixes:
55
- |
66
fixed issue #1747. Now font size is not reset after a terminal split
7-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
release_summary: >
22
-e command reinstated and now only runs in new tabs
3-
3+
44
security:
55
- |
66
guake with the -e flag now always opens a new tab to run commands in
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
release_summary: >
22
Make file link matcher not match leading words.
3-
3+
44
fixes:
55
- |
6-
- Spec files not recognized as links #1032
6+
- Spec files not recognized as links #1032

releasenotes/notes/save_subterminals-4d086becd64ffcfb.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ release_summary: >
33
44
fixes:
55
- |
6-
- A closed subterminal returns back after restarting Guake #1686
6+
- A closed subterminal returns back after restarting Guake #1686

scripts/all-sitedirs-in-prefix.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import print_function
2-
import site, os
2+
3+
import os
4+
import site
35

46
prefix = os.getenv("PREFIX")
57
for d in site.getsitepackages(None if not prefix else [prefix]):

scripts/test-exception.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def func4():
88

99

1010
def func2():
11-
func3()
11+
func3() # noqa: F821
1212

1313

1414
def func1():

0 commit comments

Comments
 (0)