Skip to content

CHORE: Enforce ruff pydocstyle D rules with available autofixes - #6520

Merged
Samuelopez-ansys merged 21 commits into
mainfrom
chore/enforce-ruff-pydocstyle-D-rules-with-autofixes
Aug 13, 2025
Merged

Samuelopez-ansys merged 21 commits into
mainfrom
chore/enforce-ruff-pydocstyle-D-rules-with-autofixes

Conversation

@ecoussoux-ansys

Copy link
Copy Markdown
Contributor

Description

This PR applies autofixes proposed by ruff for a set of D rules (related to pydocstyle, see https://docs.astral.sh/ruff/rules/#pydocstyle-d), which were until now ignored as per the configuration defined in the pyproject.toml file. The list of ignored linting rules for ruff is updated accordingly.
These particular rules are essentially related to the formatting of docstrings and missing or unwanted blank lines in files. Therefore, even though this PR introduces a large amount of changes and affects a substantial number of files, the underlying modifications really are of limited scope.

As for the previous ruff-related PRs, this effort is part of the migration of pyaedt towards using ruff for code formatting and linting, as requested in issue #4775.
This PR is also contributing to the efforts described in issue #5504.

A few modifications are also shipped with this PR on top of the fixes for the enforced D rules:

  • The version of the ruff pre-commit hook in the .pre-commit-config.yaml file is updated to the latest release,
  • A residual ruff I001 error (unsorted/unformatted import block) is fixed,
  • The PTH111 and PTH204 rules are removed from the ignore list for ruff, since no errors are being reported for them in pyaedt any longer.

Issue linked

Related to #4775 and #5504.

@ecoussoux-ansys ecoussoux-ansys self-assigned this Aug 12, 2025
@ecoussoux-ansys
ecoussoux-ansys requested a review from a team as a code owner August 12, 2025 14:38
@ecoussoux-ansys ecoussoux-ansys added the maintenance Package and maintenance related label Aug 12, 2025
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 12, 2025
@codecov

codecov Bot commented Aug 12, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.92%. Comparing base (be53324) to head (2a2de26).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6520      +/-   ##
==========================================
+ Coverage   81.90%   81.92%   +0.01%     
==========================================
  Files         236      236              
  Lines       75731    75731              
==========================================
+ Hits        62030    62043      +13     
+ Misses      13701    13688      -13     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Samuelopez-ansys Samuelopez-ansys left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@Samuelopez-ansys
Samuelopez-ansys merged commit ad6d2c9 into main Aug 13, 2025
@Samuelopez-ansys
Samuelopez-ansys deleted the chore/enforce-ruff-pydocstyle-D-rules-with-autofixes branch August 13, 2025 06:17
Devin-Crawford pushed a commit that referenced this pull request Aug 19, 2025
…6520)

Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit ad6d2c9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation maintenance Package and maintenance related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants