Skip to content

Add ruff linting#44

Draft
Pierre Siddall (Pierre-siddall) wants to merge 37 commits into
MetOffice:mainfrom
Pierre-siddall:add-ruff-linting
Draft

Add ruff linting#44
Pierre Siddall (Pierre-siddall) wants to merge 37 commits into
MetOffice:mainfrom
Pierre-siddall:add-ruff-linting

Conversation

@Pierre-siddall

Copy link
Copy Markdown
Contributor

PR Summary

Code Reviewer:

This PR aims to add a ruff linting action to the MOCI CI/CD pipeline and convert the current pylint.rc file to the ruff equivalent using a ruff.toml file

closes #15

Code Quality Checklist

(Some checks are automatically carried out via the CI pipeline)

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid undertanding and enhance the
    readability of the code
  • My changes generate no new warnings

Testing

  • I have tested this change locally, using the Moci rose-stem suite
  • If any tests fail (rose-stem or CI) the reason is understood and
    acceptable (eg. kgo changes)
  • I have added tests to cover new functionality as appropriate (eg. system
    tests, unit tests, etc.)

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

Performance Impact

  • Performance of the code has been considered and, if applicable, suitable
    performance measurements have been conducted

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance
    of Generative AI tool name (e.g., Met Office Github Copilot Enterprise,
    Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the
    Simulation Systems AI policy
    (including attribution labels)

Documentation

  • Where appropriate I have updated documentation related to this change and
    confirmed that it builds correctly

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • CLA compliance has been confirmed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Documentation is complete and accurate
  • Security considerations have been addressed
  • Performance impact is acceptable

@Pierre-siddall Pierre Siddall (Pierre-siddall) added the enhancement New feature or request label May 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces Ruff as the Python linter in the CI pipeline, replacing the previously committed Pylint configuration.

Changes:

  • Removed the legacy Utilities/pylint.rc.
  • Added Ruff configuration (ruff.toml) and a new GitHub Actions workflow to run Ruff on pull requests.
  • Added a second Ruff config under .github/ruff.toml (currently duplicative/inconsistent with the root config).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
Utilities/pylint.rc Removes the old Pylint configuration file from the repo.
ruff.toml Adds Ruff configuration for linting/formatting settings.
.github/workflows/ruff-lint.yaml Adds a PR-triggered workflow to run Ruff in CI.
.github/ruff.toml Adds an additional Ruff config file under .github/ (currently duplicates root config with small differences).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ruff.toml
Comment on lines +5 to +9
[lint]
select=["A","CPY","PLR0904","PLR0911","PLR0912","PLR0913","PLR0914","PLR0915","F901",
"B014","B025","B025","B033","PIE794","PYI016","PYI062","PT014","SIM101","PLE0241","RUF068",
"FIX"]
ignore=[]
Comment thread .github/ruff.toml
Comment on lines +1 to +9
line-length = 80
indent-width = 4
preview = true

[lint]
select=["A","CPY","PLR0904","PLR0911","PLR0912","PLR0913","PLR0914","PLR0915","F901",
"B014","B025","B025","B033","PIE794","PYI016","PYI062","PT014","SIM101","PLE0241","RUF068",
"FIX","PLR6301"]
ignore=[]
Comment thread .github/ruff.toml
Comment on lines +5 to +9
[lint]
select=["A","CPY","PLR0904","PLR0911","PLR0912","PLR0913","PLR0914","PLR0915","F901",
"B014","B025","B025","B033","PIE794","PYI016","PYI062","PT014","SIM101","PLE0241","RUF068",
"FIX","PLR6301"]
ignore=[]
Comment on lines +11 to +14
- name: Run Ruff Linter
uses: astral-sh/ruff-action@0ce1b0bf8b818ef400413f810f8a11cdbda0034b # v4.0.0
with:
version: latest
Comment thread .github/workflows/ruff-lint.yaml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Pierre-siddall Pierre Siddall (Pierre-siddall) marked this pull request as draft June 30, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configure ruff linter to lint python

3 participants