Replies: 2 comments
|
This is a big topic, so I'll start with my few strong, general opinions that are relevant here: Firstly, consistency is king. If two things look different, there should be a reason for it. To be blunt, if a patch looks the same as the lines above and below it, I rarely question it beyond that. I think you got unlucky hitting on the issue with trailing commas so quickly - there's no way you could have known how the projects I've worked on have made me unusually focussed on that problem. Secondly, a king is not a tyrant. I cordially dislike most enforcement mechanisms, because they won't shut up about that one edge case where the "bad" thing is actually the right solution. For example, notice all the errors I've had to convert to warnings in the dashboard's .eslintrc in order to make the debugging process tolerable. Conversely, the library's Finally, it's easier to ask for forgiveness than permission. Sometimes the only way to know "the" answer is to throw out "an" answer and see if anyone complains - for example, you've (reasonably) complained about a lot of the bad decisions I've made in this project, but it's been much easier to fix the minority of mistakes now than it would have been to wade through all the minutia as it came up. Here's another way to think about it: the whole of modern software development is about making it easy to try stuff and roll back if it causes problems, so you might as well embrace it! In terms of automated solutions for checking code, my focus is currently on scanning for security issues. This link for one of your projects should take you to a page with a bewildering away of products that claim to find security problems. You can get there by going to a project you own, then Settings > Security & analysis > Code scanning > Set up. I'm afraid the sheer number of choices has bumped all automated code-scanning down my priority list, to somewhere after the pipelines have matured. If you're expecting me to implement something, it'll probably be long after that. Given all of the above, how about this for a plan... Pick a program you like - you've mentioned |
|
This is now part of the discussion in #4 - please consider discussing the issue there instead. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The coding style you use is pretty unique and at times quite difficult to wrap my head around. At the same time, it's difficult to adopt your particular coding style in my PRs if I don't know if certain things are just formatting errors or deliberate design decisions (as evidenced by this PR).
To solve these issues, we could introduce either a code style or code format enforcement system.
A code style enforcement system would not just ensure proper formatting, but would enforce a set of best practices to improve the overall code quality. The options range from highly opinionated (
standard,xo,airbnb) to highly configurable (ESLint).A code formatter wouldn't meddle with the overall coding style but simply enforce a certain formatting style, i.e. trailing semicolons, indentation, trailing colons, etc.
prettierworks very well for this purpose.As I can see,
sleepdiary/dashboardalready uses ESLint, but the current rules are insufficient to enforce either a cohesive coding style or coherent code formatting.My personal preference would be a code style enforcement system like
xo, since it yields high-quality code, discourages bad practices and ensures consistency. But in the end you (@andrew-sayers) are currently the main developer on this project so the system shouldn't be a hindrance in your development process.All reactions