From 9a3c25297dc71570d20f863ea92b024e11abb064 Mon Sep 17 00:00:00 2001 From: deltragon Date: Thu, 6 Mar 2025 16:44:12 +0100 Subject: [PATCH 1/3] ci: switch to official ruff action, run check & format check --- .github/workflows/lint.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index eb7d934b..671d94ba 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,4 +9,7 @@ jobs: steps: - name: Check out source repository uses: actions/checkout@v3 - - uses: chartboost/ruff-action@v1 + - uses: astral-sh/ruff-action@v3 + # this runs `ruff check` + - run: ruff format --check + # this runs `ruff format --check`, additionally From 0a0d18e9464951482fb1e3d16021590886e31f83 Mon Sep 17 00:00:00 2001 From: deltragon Date: Thu, 6 Mar 2025 16:46:32 +0100 Subject: [PATCH 2/3] format missed file --- safeeyes/plugins/donotdisturb/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/safeeyes/plugins/donotdisturb/plugin.py b/safeeyes/plugins/donotdisturb/plugin.py index 1dfc3f54..9fb7be93 100644 --- a/safeeyes/plugins/donotdisturb/plugin.py +++ b/safeeyes/plugins/donotdisturb/plugin.py @@ -83,7 +83,7 @@ def get_active_window(x11_display): active_windows = get_window_property(root, NET_ACTIVE_WINDOW, Xlib.Xatom.WINDOW) if active_windows and active_windows[0]: active_window = active_windows[0] - return x11_display.create_resource_object('window', active_window) + return x11_display.create_resource_object("window", active_window) return None x11_display = Xlib.display.Display() From 96fb3c4d3d34167b9d41dbaac472168a34d1ff62 Mon Sep 17 00:00:00 2001 From: deltragon Date: Thu, 6 Mar 2025 15:42:17 +0100 Subject: [PATCH 3/3] mention ruff in the readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 470a1c99..e8965555 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,8 @@ Examples for translatable strings are `_("This is a string")` in Python code, or To ensure the new strings are well-formed, you can use `python validate_po.py --validate`. +To ensure that the coding and formatting guidelines are followed, install [ruff](https://docs.astral.sh/ruff/) and run `ruff check` and `ruff format --check` to check for issues, as well as `ruff check --fix` and `ruff format` to autofix them. + ## How to Release? 0. Run `update-po.sh` to generate new translation files (which will be eventually updated by translators). Commit and push the changes to the master branch.