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

Ruff linting and formatting #4604

Merged
merged 16 commits into from
Apr 12, 2024
Merged

Ruff linting and formatting #4604

merged 16 commits into from
Apr 12, 2024

Conversation

axelstudios
Copy link
Member

@axelstudios axelstudios commented Apr 2, 2024

What's this PR do?

  • Added Ruff as the Python linter/formatter for hugely improved code consistency, which replaces flake8/autoflake/isort/etc
    • To lint SEED's python files: tox -e precommit -- ruff
    • To reformat SEED's python files: tox -e precommit -- ruff-format
  • Updated spelling list
  • Replaced docker-compose calls with docker compose
  • Excluded third-party packages in /src/* from MyPy testing
  • Removed unused code
  • Fixed typos
  • Fixed npm-shrinkwrap.json references
  • Updated documentation

How should this be manually tested?

The CI should pass

@axelstudios axelstudios added DO NOT MERGE Maintenance Tag as maintenance if the issue relates to general cleanup, maintenance, etc. Do not delete label. labels Apr 2, 2024
@axelstudios axelstudios requested a review from kflemin April 2, 2024 19:51
# Conflicts:
#	seed/data_importer/match.py
#	seed/utils/inventory_filter.py
@axelstudios axelstudios changed the title WIP: Ruff linting Ruff linting and formatting Apr 11, 2024
Copy link
Member

@nllong nllong left a comment

Choose a reason for hiding this comment

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

looks good. Ruff is so much faster than autopep--so nice.

I fixed a couple more typos and formatted the local_untracked.py.dist file.

attrs={'class': 'field', 'placeholder': 'Password'})
self.fields['password2'].widget = forms.PasswordInput(
attrs={'class': 'field', 'placeholder': 'Confirm Password'})
super().__init__(*args, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

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

wow, old python 2.7 relic

@@ -41,7 +37,7 @@
TaxLotAuditLog,
TaxLotProperty,
TaxLotState,
TaxLotView
TaxLotView,
Copy link
Member

Choose a reason for hiding this comment

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

yes, I love this setting... being serious.

name='create',
decorator=[has_perm_class('requires_owner')]
)
@method_decorator(name="list", decorator=[has_perm_class("requires_owner")])
Copy link
Member

Choose a reason for hiding this comment

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

cleaner, nice


setattr(property_measure, key, value)
updated_value = value
if key in self.enum_validators:
Copy link
Member

Choose a reason for hiding this comment

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

much better way to iterate over keys

@axelstudios axelstudios merged commit f5ac42f into develop Apr 12, 2024
9 checks passed
@axelstudios axelstudios deleted the task/ruff branch April 12, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Tag as maintenance if the issue relates to general cleanup, maintenance, etc. Do not delete label.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants