Skip to content

chore: linting and formatting#134

Open
knightjoel wants to merge 9 commits intoapetrycki:masterfrom
knightjoel:chore/linting
Open

chore: linting and formatting#134
knightjoel wants to merge 9 commits intoapetrycki:masterfrom
knightjoel:chore/linting

Conversation

@knightjoel
Copy link
Copy Markdown
Contributor

  • Use black, flake8, and isort to format and delint the Python code
  • Find and fix some whitespace issues in .md and .yml files
  • Find and fix some syntax errors in .json file

To ensure no regressions:

  1. Provide a pre-commit configuration file so developers can run these linters locally at commit time.
  2. Provide a GitHub Actions job to run these linters whenever a PR is opened or a push happens on a branch other than master.

@knightjoel
Copy link
Copy Markdown
Contributor Author

knightjoel commented Aug 6, 2025

Hi @apetrycki, I wanted to give you a look at something I've been working on.

I believe with this commit 1/ the code is cleaner and will have a more consistent style and 2/ there will be a mechanism in place to catch simple bugs (using flake8 is how I found #132) which improves reliability of the code. You can see an example of the GitHub action run here.

This is mostly finished, but I may still tinker with it. There are no intentional functional changes, but I'm running with these linting fixes just to be sure.

@knightjoel knightjoel marked this pull request as ready for review August 21, 2025 03:24
@apetrycki
Copy link
Copy Markdown
Owner

@knightjoel What is your feeling at this point? Should I merge it all in, or are you still working on some things?

@knightjoel
Copy link
Copy Markdown
Contributor Author

Hello! This is ready to merge.

sensors.append({"name": f"{name} Indoor", "value": thermostat['aqIndoorParticlesValue'], "type": "particle"})
sensors.append({"name": f"{name} Indoor", "value": thermostat['aqIndoorValue'], "type": "score"})
sensors.append({"name": f"{name} Indoor", "value": thermostat['aqIndoorVOCValue'], "type": "VOC"})
sensors.append(
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The formatting for these sensors.appends is kinda painful. Is there a way to exclude this section from the auto formatting?

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.

2 participants