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

Stricter Linting for smoother PR integration #154

Open
3 tasks done
bullitt186 opened this issue Jun 27, 2024 · 2 comments
Open
3 tasks done

Stricter Linting for smoother PR integration #154

bullitt186 opened this issue Jun 27, 2024 · 2 comments
Labels
build Build System and Dependencies

Comments

@bullitt186
Copy link
Contributor

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

When filing a PR, i got to the stage of PR review and only realized then that while working on the PR, i messed up source code formatting. THis means now tedious fixing of the PR. Ideally, I would have been guided earlier in the process that i am deviating from the standard.

Describe the solution you'd like

Introduce stricter Linting Rules, following the linting strategy + rules the home assistant project itself uses.

Home Assistant uses:

THey follow the PEP8 + PEP257 Guidelines [source] (https://developers.home-assistant.io/docs/development_guidelines#our-recommendations)

I suggest to take over the Home Assistant's project configurations to assure adherence to the project's standards and best practices..

In detail this would mean:

  • take over the linting aspects of pyproject.toml + it's associated files from HA core
  • adjust the .devcontainer file accordingly
  • add the VSCode extensions for the linters in the .vscode configuration
  • Introduce Pre-Commit hooks to ensure compliance to these rules. (See e.g. .pre-commit-config.yaml in the HA core repo or pre-commit.com

Describe alternatives you've considered

In case strict linting shall not be enforced, the suggested standards could be mentioned in CONTRIBUTING.md

Additional context

In case you are fine with the suggested approach, i can work on a PR with the suggested changes.

Diagnostics dump

No response

@bullitt186 bullitt186 added the enhancement New feature or request label Jun 27, 2024
@torbennehmer
Copy link
Owner

I think that is a good roadmap. Let's tackle this once we get 3.8 with WB support out of the way. I'd also like to have some rules for the MD files (I've something ready there from work, I'll take that over). Especially, if we (as you rightfully said) add a documentation wiki or something like that.

@torbennehmer torbennehmer added build Build System and Dependencies and removed enhancement New feature or request labels Jul 2, 2024
@bullitt186
Copy link
Contributor Author

Sounds good!
I am happy to work on it (as time allows - as usual :-))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build System and Dependencies
Projects
None yet
Development

No branches or pull requests

2 participants