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

Use ruff instead of black+flake8 #1671

Merged
merged 7 commits into from Jan 29, 2024
Merged

Use ruff instead of black+flake8 #1671

merged 7 commits into from Jan 29, 2024

Conversation

arkid15r
Copy link
Collaborator

Proposed change

Resolves #1670
Switched to ruff. It works great, had to make some modifications though.

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new python-holidays functionality in general)

Checklist

  • I've followed the contributing guidelines
  • I've run make pre-commit, it didn't generate any changes
  • I've run make test, all tests passed locally

@PPsyrius
Copy link
Contributor

PPsyrius commented Jan 27, 2024

From a quick glance, it seems like you'll need to set a separate max-string-length to 99 again, too, in the pyproject.toml.

[tool.ruff.lint.flake8-errmsg]
max-string-length = 99

Update: here's the setting I play around with to mimic the existing linter rules we have - interestingly enough, ruff seems to be handling Abugida writing system char count well, unlike flake8 and black.

pyproject.toml

[tool.ruff]
line-length = 99
target-version = "py38"

[tool.ruff.lint]
# Skip Whitespace before ':' (E203).
ignore = ["E203"]

IMO, once rust properly supports isort's multi_line_output we can probably get rid of that one too.

@coveralls
Copy link

coveralls commented Jan 27, 2024

Pull Request Test Coverage Report for Build 7701360664

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 0 of 5 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 7689599421: 0.0%
Covered Lines: 10424
Relevant Lines: 10424

💛 - Coveralls

Copy link
Collaborator Author

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

I've added flake8-errmsg suggestion (even though it doesn't seem to make any difference for now). The E203 one is still in preview, I guess it can wait.

.pre-commit-config.yaml Outdated Show resolved Hide resolved
tests/countries/test_laos.py Outdated Show resolved Hide resolved
tests/countries/test_laos.py Outdated Show resolved Hide resolved
tests/countries/test_thailand.py Outdated Show resolved Hide resolved
@KJhellico
Copy link
Collaborator

LGTM! let's ruff it! 🚀

Copy link
Collaborator Author

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

All right, I've fixed those " " cases!

Thanks for the thorough review! 👍

--
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Copy link

sonarcloud bot commented Jan 29, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

8 New issues
0 Security Hotspots
No data about Coverage
0.1% Duplication on New Code

See analysis details on SonarCloud

@arkid15r arkid15r added this pull request to the merge queue Jan 29, 2024
Merged via the queue into vacanza:beta with commit db42395 Jan 29, 2024
26 checks passed
@arkid15r arkid15r deleted the use-ruff branch January 29, 2024 19:35
@KJhellico KJhellico mentioned this pull request Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider migration to ruff
4 participants