You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a contributor, I would like tools that help me (and my editor) produce code in a style consistent with the repository's existing style – and that stop me from making silly mistakes as I code. I would also like the code to be checked for mistakes and code style consistency when I commit. That way, I can be more confident that my code will please the maintainer, resulting in fewer back-and-forth exchanges and a higher chance of my contributions becoming part of the final product.
Suggested solution
Note: The reporter knows that code style, like most matters of taste, is a controversial matter. He is very open to discussing the details or being told "no".
Use lint-staged to automatically enforce best practices on commit.
Arguments against checking quality as code is committed
While the reporter thinks that the best choice is to check code on commit and blocking the commit if errors are found, there is a good argument not to: Programmers who lack experience with these tools (or like to commit "intermediary" commits that do not necessarily adhere to quality standards) are sometimes frustrated by tools that block them from committing. However, as commit hooks can be skipped by using the --no-verify argument to git commit, having these checks should be considered more of an advantage than an annoyance.
The text was updated successfully, but these errors were encountered:
Vages
changed the title
Check code quality automatically on commit
Improve code quality automatically
May 2, 2020
As a contributor, I would like tools that help me (and my editor) produce code in a style consistent with the repository's existing style – and that stop me from making silly mistakes as I code. I would also like the code to be checked for mistakes and code style consistency when I commit. That way, I can be more confident that my code will please the maintainer, resulting in fewer back-and-forth exchanges and a higher chance of my contributions becoming part of the final product.
Suggested solution
Note: The reporter knows that code style, like most matters of taste, is a controversial matter. He is very open to discussing the details or being told "no".
lint-staged
to automatically enforce best practices on commit.Arguments against checking quality as code is committed
While the reporter thinks that the best choice is to check code on commit and blocking the commit if errors are found, there is a good argument not to: Programmers who lack experience with these tools (or like to commit "intermediary" commits that do not necessarily adhere to quality standards) are sometimes frustrated by tools that block them from committing. However, as commit hooks can be skipped by using the
--no-verify
argument togit commit
, having these checks should be considered more of an advantage than an annoyance.The text was updated successfully, but these errors were encountered: