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

Code formatting and pre-commit hooks #492

Closed
stefsmeets opened this issue Mar 1, 2023 · 1 comment · Fixed by #508
Closed

Code formatting and pre-commit hooks #492

stefsmeets opened this issue Mar 1, 2023 · 1 comment · Fixed by #508

Comments

@stefsmeets
Copy link
Contributor

Dianna runs a fairly strict pylint configuration that is somewhat complainy. It's also slow, which makes it a bit of a chore to run while doing the prospector/pylint dance.

Many of the issues it raises are easily fixed by using code formatters like autopep8, yapf, or black. I would be happy to configure one of these (yapf or autopep8 would be my choice) for dianna for code consistency and saving my time.

I'm not in favour of running too many linters/formatters locally, like the documentation recommends. And the pre-commit hook hides the output and requires some manual steps to apply the fixes.

There is an excellent tool called pre-commit that makes it very easy to configure different checks, with automated fixes and it only runs on the code that has been changed. If you agree, I will happily configure it for dianna to run one of the autoformatters above, as well as pylint/pycodestyle.

@cwmeijer
Copy link
Member

cwmeijer commented Mar 8, 2023

This would be great and will save us a lot of time for sure.

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 a pull request may close this issue.

2 participants