Skip to content

Commit

Permalink
Add pre-commit config and apply all fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hackedd authored and Davidy22 committed Oct 27, 2022
1 parent 96ef772 commit 86bb9b5
Show file tree
Hide file tree
Showing 22 changed files with 94 additions and 51 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ For how to run the latest Guake in your computer, please refer to [Install from

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

This allow us to spot directly which are the most requested features.

This allows us to spot directly which are the most requested features.
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ Please follow these steps before submitting a new Pull Request to Guake:

- Semantic commit is supported (and recommended). Add one of the following
line in your commit messages:

```
# For a bug fix, uses:
sem-ver: bugfix

# For a new feature, uses:
sem-ver: feature
# Please do not use the 'breaking change' syntax (`sem-ver: api-break`),

# Please do not use the 'breaking change' syntax (`sem-ver: api-break`),
# it is reserved for really big reworks
```
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
make test-actions
# prepare for deployment
make generate-paths
- uses: Thog/action-equals@v1
id: isLatest
with:
Expand Down
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
args:
- "--markdown-linebreak-ext=md"
exclude: COPYING
- repo: https://github.com/PyCQA/flake8.git
rev: 3.9.2
hooks:
- id: flake8
- repo: https://github.com/PyCQA/pylint.git
rev: v2.13.6
hooks:
- id: pylint
- repo: https://github.com/psf/black.git
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/hackedd/fiximports.git
rev: 19bd841
hooks:
- id: fiximports
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
prune .github
prune git-hooks
prune releasenotes
include guake *
prune guake/tests
Expand Down
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ compile-glib-schemas-dev: clean-schemas
clean-schemas:
rm -f $(DEV_DATA_DIR)/gschemas.compiled

style: black
style:
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run pre-commit run --all-files

black:
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run black $(MODULE)
Expand Down Expand Up @@ -312,15 +313,12 @@ freeze:
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run pip freeze


githook:
bash git-hooks/post-commit

setup-githook:
rm -f .git/hooks/post-commit
cp -fv git-hooks/* .git/hooks/
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run pre-commit install


push: githook
push:
git push origin --tags


Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pew = "*"
black = "==21.8b0"
flakehell = "*"
toml = "*"
pre-commit = "==2.17.0"

[packages]
pbr = "*"
Expand Down
44 changes: 42 additions & 2 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/source/contributing/dev_env.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ You can reinstall easily in your environment (only validated for Debian/Ubuntu)
Git hook
========

Please install this git hook if you want to beautify your patch before submission:
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:

.. code-block:: bash
$ make setup-githook
$ pipenv run pre-commit run --all-files
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Useful links
- Source Code available on `GitHub <https://github.com/Guake/guake/>`_.
- Official Homepage: http://guake-project.org
- Online Documentation is hosted on `ReadTheDocs <http://guake.readthedocs.io/>`_.
- If you are not a developer, you can still contribute to Guake by
- If you are not a developer, you can still contribute to Guake by
`improving its translations in your language <https://hosted.weblate.org/projects/guake/guake/>`_.
Guake users are welcome `to support Weblate <https://weblate.org/donate/>`_ in providing this
service for free for OpenSource Projects.
Expand Down
18 changes: 0 additions & 18 deletions git-hooks/post-commit

This file was deleted.

2 changes: 1 addition & 1 deletion guake/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from gi.repository import Gtk
from guake.about import AboutDialog
from guake.dialogs import SaveTerminalDialog
from guake.globals import ENGINES
from guake.prefs import PrefsDialog
from guake.utils import FullscreenManager
from guake.utils import HidePrevention
from guake.utils import get_server_time
from guake.globals import ENGINES
from urllib.parse import quote_plus


Expand Down
5 changes: 2 additions & 3 deletions guake/data/guake.desktop.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<description>
<p>
Guake is a top-down terminal for Gnome, and is highly inspired by the famous terminal used in Quake.
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.
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.
</p>
<p>
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.
You can do it at lightning speed without leaving your keyboard.
Just press your predefined "Show Guake" hotkey, execute your command, and press it again to hide the terminal and go back to your work.
Just press your predefined "Show Guake" hotkey, execute your command, and press it again to hide the terminal and go back to your work.
</p>
</description>

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

2 changes: 1 addition & 1 deletion guake/keybindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import gi

gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Gtk

from guake import notifier
from guake.common import pixmapfile
Expand Down
2 changes: 1 addition & 1 deletion guake/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
from guake.globals import ALIGN_RIGHT
from guake.globals import ALIGN_TOP
from guake.globals import ALWAYS_ON_PRIMARY
from guake.globals import ENGINES
from guake.globals import MAX_TRANSPARENCY
from guake.globals import NAME
from guake.globals import QUICK_OPEN_MATCHERS
from guake.globals import ENGINES
from guake.palettes import PALETTES
from guake.paths import AUTOSTART_FOLDER
from guake.paths import LOCALE_DIR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ release_summary: >
features:
- |
- Add new accelerator to open a link or URL under the terminal cursor #2060
1 change: 0 additions & 1 deletion releasenotes/notes/bugfix-bfcece2fed005b98.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ release_summary: >
fixes:
- |
fixed issue #1747. Now font size is not reset after a terminal split
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
release_summary: >
-e command reinstated and now only runs in new tabs
security:
- |
guake with the -e flag now always opens a new tab to run commands in
4 changes: 2 additions & 2 deletions releasenotes/notes/file_open_regex-1a6db403d54601e0.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
release_summary: >
Make file link matcher not match leading words.
fixes:
- |
- Spec files not recognized as links #1032
- Spec files not recognized as links #1032
2 changes: 1 addition & 1 deletion releasenotes/notes/save_subterminals-4d086becd64ffcfb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ release_summary: >
fixes:
- |
- A closed subterminal returns back after restarting Guake #1686
- A closed subterminal returns back after restarting Guake #1686
4 changes: 3 additions & 1 deletion scripts/all-sitedirs-in-prefix.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import print_function
import site, os

import os
import site

prefix = os.getenv("PREFIX")
for d in site.getsitepackages(None if not prefix else [prefix]):
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def func4():


def func2():
func3()
func3() # noqa: F821


def func1():
Expand Down

0 comments on commit 86bb9b5

Please sign in to comment.