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

fix ASF update action to fix unused imports #10527

Merged
merged 1 commit into from Mar 25, 2024
Merged

fix ASF update action to fix unused imports #10527

merged 1 commit into from Mar 25, 2024

Conversation

alexrashed
Copy link
Member

Motivation

The latest ruff upgrade switched some defaults avoiding unsafe fixes to remove unused imports in init dunder files (since they would change the API interface of the module): astral-sh/ruff#10365 contained in 0.3.3.
This causes our ASF update action to fail because of unfixed linting errors: https://github.com/localstack/localstack/actions/runs/8415318713

The changes in the defaults are safe, but we want to explicitly fix this for the generated APIs (which is all in the init dunder) explicitly directly when generating them.

Changes

This PR explicitly executes an unsafe lint fix with a changed config on the generated APIs in the ASF update action.

Testing

Tested locally:

source .venv/bin/activate
python3 -m localstack.aws.scaffold generate ec2 --save
ruff check --select F401 --unsafe-fixes --fix . --config "lint.ignore-init-module-imports = false"
make format-modified

@alexrashed alexrashed added the semver: patch Non-breaking changes which can be included in patch releases label Mar 25, 2024
@alexrashed alexrashed added this to the 3.3 milestone Mar 25, 2024
@alexrashed alexrashed requested a review from silv-io March 25, 2024 09:05
@alexrashed alexrashed self-assigned this Mar 25, 2024
Copy link
Member

@silv-io silv-io left a comment

Choose a reason for hiding this comment

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

LGTM! Interesting change in behaviour

@silv-io silv-io merged commit bb20f36 into master Mar 25, 2024
22 of 23 checks passed
@silv-io silv-io deleted the fix-ruff-config branch March 25, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants