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

Configure autoflake for pre-commit #82414

Merged
merged 3 commits into from Nov 22, 2022
Merged

Conversation

akx
Copy link
Contributor

@akx akx commented Nov 20, 2022

Proposed change

This PR configures the autoflake linter in the pre-commit configuration and runs it. (I checked with git log -S autoflake that this hadn't been considered before.)

The main benefit is that autoflake can clean up unused imports and variables that other linters down the line would complain about.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Checklist

  • The code change is tested and works locally.
  • Local tests pass.
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

To help with the load of incoming pull requests:

.pre-commit-config.yaml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
@akx akx requested review from balloob and removed request for frenck November 22, 2022 05:52
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks @akx 👍

@frenck frenck merged commit e4c7325 into home-assistant:dev Nov 22, 2022
@akx akx deleted the pre-commit-autoflake branch November 22, 2022 09:34
@balloob
Copy link
Member

balloob commented Nov 22, 2022

What’s the benefit of autoflake while we also use Black ?

@frenck
Copy link
Member

frenck commented Nov 22, 2022

It cleans up unused imports (that is basically all it does). Not much more (so it doesn't do the full flake8 suite, as the name implies).

aidengindin pushed a commit to aidengindin/core that referenced this pull request Nov 22, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants