Skip to content

Random suggestions from a non-claude-ccode user #17

Description

@sanzoghenzo

Hi @philippb, you've done a great job!

I don't personally use claude code, but I'm planning to take advantage of your work and adapt it to other agents (such as sst's OpenCode).

I've analyzed your work and I would like to point you to some enhancements. They are mostly subjective, but they more or less comes from my python development toolchain that I use daily.

  • instead of trying to manage the virtual environment, use uv. It is wonderful to manage python projects and their environments! uv run python script.py will automatically create the virtual environment with the dependencies listed in pyproject.toml and run the script inside it.
  • instead of make, i use task: cross platform, yaml based task definition. I also use it to ensure uv and other needed tools are installed (nothing that can't be done with make, but I find it much more clear to read)
  • black, flake8 and pylint can be substituted with ruff, hyper-fast linter and formatter (from the same guys of uv, I've become a fanboy!)
  • this is something I find just the other day, but prek is a drop-in replacement for pre-commit that is faster and lighter (in terms of space)
  • Still in preview, but uv/ruff guys are developing ty that could replace mypy someday (I just tested it today and it's working well and reaaaaally fast compared to mypy)
  • instead of creating python/bash scripts to run the linters/chekers, you can just call pre-commit run --all-files (or prek run --all-files). You can also use it as pre/post tool hook (something like prek yamlint --directory config will run only the yaml linter in the config directory, for example)

And here's one suggestions for the code itself: instead of calling home assistant via subprocess and going through the hassle of parsing stdout/stderr, you can just import the right module and run the underlying function, for example the config_check command calls the homeassistant.scripts.check_config.check(config_dir) function that returns a dictionary with "except" and "warn" keys.
Again, using uv run python script.py wil automatically add homeassistant to the virtual environment since you declared it as a dependency, so no need to check for executables or try to run python -m homeassistant.

happy thinkering!

Metadata

Metadata

Assignees

No one assigned

    Labels

    future considerationGood ideas to consider for future development

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions