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

Switch to ruff for formatting and linting #169

Merged
merged 4 commits into from
Feb 29, 2024
Merged

Conversation

exg
Copy link
Contributor

@exg exg commented Feb 29, 2024

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Feb 29, 2024

Codecov Report

Attention: Patch coverage is 47.82609% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 72.64%. Comparing base (db19245) to head (ed9732e).

Files Patch % Lines
rohmu/object_storage/azure.py 16.66% 5 Missing ⚠️
rohmu/object_storage/google.py 40.00% 3 Missing ⚠️
rohmu/compat.py 0.00% 2 Missing ⚠️
rohmu/common/statsd.py 0.00% 1 Missing ⚠️
rohmu/inotify.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #169   +/-   ##
=======================================
  Coverage   72.64%   72.64%           
=======================================
  Files          36       36           
  Lines        4058     4058           
=======================================
  Hits         2948     2948           
  Misses       1110     1110           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


.PHONY: mypy
mypy:
$(PYTHON) -m mypy --show-error-codes $(PYTHON_SOURCE_DIRS)

.PHONY: fmt
fmt:
isort $(PYTHON_SOURCE_DIRS)
black $(PYTHON_SOURCE_DIRS)
ruff format $(PYTHON_SOURCE_DIRS)

Choose a reason for hiding this comment

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

Suggested change
ruff format $(PYTHON_SOURCE_DIRS)
ruff check --fix $(PYTHON_SOURCE_DIRS)
ruff format $(PYTHON_SOURCE_DIRS)

suggestion: Also allow auto-fixing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added, limited to isort rules, as I don't think the fmt target should fix other violations.

Choose a reason for hiding this comment

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

That's OK, but now I'm curious as to why 😄 In my experience the ruff auto-fixers exceedingly rarely does the wrong thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is not about that, but rather about semantics. I think that a target that is supposed to format code should not make unrelated changes.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@exg exg marked this pull request as ready for review February 29, 2024 14:38
@aiven-anton
Copy link

This LGTM, but I'm not authorized to merge in this repository.

Copy link
Contributor

@giacomo-alzetta-aiven giacomo-alzetta-aiven left a comment

Choose a reason for hiding this comment

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

LGTM

@giacomo-alzetta-aiven giacomo-alzetta-aiven merged commit feb4f10 into main Feb 29, 2024
8 checks passed
@giacomo-alzetta-aiven giacomo-alzetta-aiven deleted the exg-ruff branch February 29, 2024 16:45
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.

4 participants