Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ruff python linter into CI #142

Open
ThibFrgsGmz opened this issue May 7, 2023 · 0 comments
Open

Add ruff python linter into CI #142

ThibFrgsGmz opened this issue May 7, 2023 · 0 comments
Labels
Interface: Python Kind: Improvement This is a proposed improvement Priority: normal Status: Design Issue at Design phase of the quality assurance process

Comments

@ThibFrgsGmz
Copy link
Contributor

High level description

The objective of this request is to integrate the Python Ruff linter into the CI of the Nyx project. The use of the Ruff linter will ensure code quality by detecting style errors, syntax issues and potential problems before the code is integrated into the main project.

Requirements

  • Integrate the Ruff linter into the Nyx project CI process.
  • Automatically run the Ruff linter on each Pull Request submitted.
  • Report errors or warnings detected by the linter.
  • Prevent Pull Requests containing errors detected by the linter from being merged.

Test plans

  • Create unit tests to verify that the Ruff linter is correctly integrated and executed during Pull Requests.
  • Submit Pull Requests with different types of errors (style, syntax, etc.) to verify that the linter correctly detects and reports these errors.
  • Test borderline cases where unusual errors or warnings may occur.

Design

The idea behind this integration is to ensure that all code submitted in Pull Requests follows coding standards and best practices to avoid potential problems when integrating the code into the main project.

Algorithm demonstration

No algorithm changes are required for this integration.

API definition

No changes to the Nyx APIs are required for this integration.

High level architecture

  • Integrate the Ruff linter into the CI configuration.
  • Configure the Ruff linter rules to align with the Nyx project coding standards.
  • Run the Ruff linter on each Pull Request submitted and display the results in the platform interface.

Detailed design

  • Add a step in the CI configuration to install and run the Ruff linter.
  • Create a Ruff configuration file (e.g. .ruff.toml) to define Nyx project-specific rules (see https://github.com/charliermarsh/ruff#configuration).
  • Configure the CI system to run the Ruff linter on each Pull Request and report any errors or warnings detected.
  • Ensure that errors detected by the Ruff linter prevent the Pull Request from being merged until the issues are resolved.
  • Convert the Ruff output to a SARIF file for upload to GitHub Security for direct feedback in the code review.

Once the CI configuration has been updated and the Ruff linter rules defined, Nyx contributors will benefit from automated code quality control, ensuring better maintainability and code quality throughout the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interface: Python Kind: Improvement This is a proposed improvement Priority: normal Status: Design Issue at Design phase of the quality assurance process
Projects
None yet
Development

No branches or pull requests

2 participants