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 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. 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()