From daac9c325bf075fb6920858577b8586efc74d277 Mon Sep 17 00:00:00 2001 From: Saman Rassam Date: Tue, 17 Nov 2026 17:02:06 +0100 Subject: [PATCH 1/3] Update style guide for Ruff linting and formatting --- docs/procedures/style_guidelines.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/procedures/style_guidelines.md b/docs/procedures/style_guidelines.md index 436bbc0a2..2d96cc6f5 100644 --- a/docs/procedures/style_guidelines.md +++ b/docs/procedures/style_guidelines.md @@ -10,7 +10,9 @@ As of writing (August 1st 2025), the code owners of this repository should adher #### [Lint with Pylint](https://google.github.io/styleguide/pyguide.html#21-lint) -This repository does not currently use pylint. We will not be adding this while introducing this style guideline file. For formatting, we use Black. +This repository uses Ruff instead of pylint and Black, for both linting and formatting. `ruff check` includes the stable pylint rules that Ruff implements (`PL`). The configuration, including which rules are selected or ignored and which files are excluded from linting, is under `[tool.ruff]` and `[tool.ruff.lint]` in `pyproject.toml`. + +The Ruff workflow (`.github/workflows/lint-ruff.yml`) runs `ruff check .` and `ruff format --check .` on pushes and pull requests that change Python files or `pyproject.toml`. To fix issues locally, run `ruff check --fix .`, which fixes what it can automatically, and `ruff format .`. Use the Ruff version that the workflow installs, since other versions can lint and format differently. #### [Imports](https://google.github.io/styleguide/pyguide.html#22-imports) @@ -20,4 +22,4 @@ Whereas the above is what should be what's strived for, the code does import typ #### [Line length](https://google.github.io/styleguide/pyguide.html#32-line-length) -The maximum line length in this repository should be 120 characters, making it consistent with the dds_cli repository. Pylint is however not implemented in this repository at this time, and Black is currently not configured to use another formatting other than default, so the maximum number of characters per line is currently 88 via Black. If and when pylint is added, 120 characters should be added to the `.pylintrc`. +The line length in this repository is 100 characters, set by `line-length` in `pyproject.toml`. `ruff format` wraps code to this length where it can, but it does not split long strings, comments or docstrings, and line length is not linted (`E501` is ignored), so some lines are longer. From f182f669832b13a2b6d96d3d84e0dd1500c63f69 Mon Sep 17 00:00:00 2001 From: Saman Rassam Date: Tue, 17 Nov 2026 17:18:26 +0100 Subject: [PATCH 2/3] sprintlog --- SPRINTLOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SPRINTLOG.md b/SPRINTLOG.md index 5487c11ec..e51e14c63 100644 --- a/SPRINTLOG.md +++ b/SPRINTLOG.md @@ -613,3 +613,4 @@ _Empty sprint_ - Fix --no-prompt silently skipping user activation and deactivation ([#1008](https://github.com/ScilifelabDataCentre/dds_cli/pull/1008)) - Remove resolved entries from dds_failed_delivery.json after retry ([#999](https://github.com/ScilifelabDataCentre/dds_cli/pull/999)) +- Update style guide for Ruff linting and formatting ([#1011](https://github.com/ScilifelabDataCentre/dds_cli/pull/1011)) From 172cfcc7d27f5b8d0cd169e0cb3f2cf8c6dba999 Mon Sep 17 00:00:00 2001 From: Saman Rassam Date: Tue, 24 Nov 2026 18:04:47 +0100 Subject: [PATCH 3/3] Added word to style_guidelines.md per review comments --- docs/procedures/style_guidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/procedures/style_guidelines.md b/docs/procedures/style_guidelines.md index 2d96cc6f5..1b8cc2be6 100644 --- a/docs/procedures/style_guidelines.md +++ b/docs/procedures/style_guidelines.md @@ -22,4 +22,4 @@ Whereas the above is what should be what's strived for, the code does import typ #### [Line length](https://google.github.io/styleguide/pyguide.html#32-line-length) -The line length in this repository is 100 characters, set by `line-length` in `pyproject.toml`. `ruff format` wraps code to this length where it can, but it does not split long strings, comments or docstrings, and line length is not linted (`E501` is ignored), so some lines are longer. +The maximum line length in this repository is 100 characters, set by `line-length` in `pyproject.toml`. `ruff format` wraps code to this length where it can, but it does not split long strings, comments or docstrings, and line length is not linted (`E501` is ignored), so some lines are longer.