Context
I am positively surprised by the amount of code quality verifications that can be performed automatically. Accordingly, I thought it may be valuable for other people that are not familiar with pre-commit
or that do not have the know-how on how to set up such a configuration on their own device, to get pre-commit
feedback on the code that they are asking questions about.
Assumptions
Additionally, I make the following assumptions:
- This forum aims to appreciate questions that require significant expertise to answer. (To keep attracting experienced users/keep experienced users interested). (So off-loading "trivial" feedback into
pre-commit
may allow users to focus on more difficult questions). - I assume some code review questions can be answered using automatic code quality verification alone. And/or that the question poster could learn more things to improve about their code through automated code quality verification (than only that which is replied to).
- Given that pre-commit for Python repositories alone already supports over 14 hooks, and approximately 23 built in checks, I assume quite a bit of submitted code fragments could benefit from such an automated check.
Question
Hence, I was wondering whether people on this site would be interested in integrating such an automated, opinionated checker in the question upload section.
Note
- This is not to suggest that pre-commits could answer/resolve arbitrary questions, merely that it may be a support tool to provide (new) coders with more feedback on the quality of their code.
- I am aware opinions differ, so I think it is important people should be both able to ignore the
pre-commit
and configure thepre-commit
configuration, yet having some default configuration may actually be valuable for a lot of people that are relatively new to coding. - Hosting such service on the site, may attract unwanted attention, if default spam detection is not able to deter such unwanted attention, it may be possible to allow new/unverified/untrusted users to cover their own computation costs using micropayments using their metamask/litecoin/monero or whatever.
- This question is not related to how that should be implemented. This question is about whether people would think it would add (sufficient) value.
- I am not affiliated with pre-commit or anything, the software just helps and teaches me a lot about my own work.
Straw-person arguments
Based on the votes in this related post from 7 years ago, the consensus seemed to be (oversimplified):
- "linters are bad" - As explained in the comments, I think this argument is slightly elitist. Additionally, this argument can be mitigated by making the
pre-commit
feedback optional. I expect many (less-advanced) users, such as myself, could find great value based on such automated feedback. I feel like the documentation and feedback ofpre-commit
/linters has been increased significantly since 7 years ago. However, perhaps I have grown faster in my understanding than these linters have grown in feedback quality. I think the safest way to determine the added value of such a linter, would be to build the option in the code-review site as optional, and perform surveys on whether users understood the feedback, and whether they considered it valuable. - "people can figure install their own linting tools".
I think the people that would benefit the most from such
pre-commit
feedback have no idea that they can actually install extensions that perform automated code quality checks for them. On top of that, in my experience, it is often still a bit challenging to get such extensions to work properly. So I think the hurdle to learn from automated feedback would be smallest if the feedback is provided optionally and directly in the "post-question" section.
So I would like to make a plea to re-consider, build the option, perform a survey and conclude based on the survey data interpretation.
Note, I am aware that there exist limited resources, so a reason to not do this, would be that working on other topics is considered more valuable. This is solely an argument between: "no automated code quality feedback option" and "having the option to receive automated code quality feedback when posting a question".
pre-commit
check "optional" (and disabled by default). I do sympathise with: "the output is too difficult for new users", though I think that up to a significant extent could be resolved over time with effort. Alternatively, users could ask questions about this confusion to learn more. \$\endgroup\$