-
Notifications
You must be signed in to change notification settings - Fork 6
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
Proposal: Default rule list, move default rules to bugprone
#320
Conversation
5a58658
to
d2ec064
Compare
Looking through the rules, there are a couple that I think should perhaps be recategorised:
I'm also looking at all of the rules for handling real types/kinds, and thinking perhaps it was a bad idea to split them between
Could we move things around before the merge? It's probably best for us to figure out exactly where things should be beforehand, so I think that should be the last thing we do in this PR.
I think that's okay, as I'd like to move a bunch of rules out of preview for the next release anyway. |
Yes, I think that's reasonable
Hmm, maybe more like
Oh yes, that's a little awkward, though I'm not sure it's inaccurate.
If it's "just" rearranging, then maybe a separate PR?
Yes, that was exactly my intention too! :)
The ones that were preview in the last release? |
Good point, I hadn't spotted that this syntax is considered obsolescent in the standards.
Sure, I was just thinking that it's probably best to do all recategorising now while we're already at it.
Yes, at least the uncontroversial ones. For example, I'd argue that |
Sure, that's also reasonable! |
While I see the value in being able to say a whole category is in the default, it seems a bit of a stretch to label everything like this "bugprone", specifically rules like Perhaps it is worth instead slimming down the number of categories? I'll note that the open-catalog here https://github.com/codee-com/open-catalog only has 4 categories As for defining defaults, having to move a rule to a new category just because it should be default-on seems to be a disruptive change, especially if the plan will be to add rules that are off by default and then transition them to being on after more usage and testing shows they work and are valuable. |
My reasoning for Yes,
Yes, see #269 for some discussion on this. I do like
It's less about requiring the default rules to be in a default-on category, but that maybe having a default-on category suggests the original categorisation of these particular rules wasn't quite correct, if that makes sense. Any kind of reorganisation is going to be at least a little disruptive, but the rule redirects do actually take a lot of the pain out of that -- the old code still works for selecting and ignoring, and the user gets a warning about the new name. However, I do think it would be best to try and consolidate any potential disruption, rather than spreading it out and having every update break something. It does seem like people are generally happy to just turn off the individual rules they don't want, so it's possible we're worrying too much about this and could default to everything on! |
I would hope that we wouldn't need to shuffle things around very often after this update, as this will result in there being a stricter hierarchy of rule categories:
In my mind, by making
I'm not so sure, because right now I'm still not entirely on-board with this change, but here are a the pros and cons from where I'm standing: Pros
Cons
Overall, I'm leaning in favour of the recategorisation. My biggest worry is that a breaking change of this nature might be sufficiently annoying to scare off some of our current users, but I also worry that our current system is unsustainable, and the later we wait to make a large breaking change the bigger the problems will be. @ZedThree Do you have anything else you would like to add that might swing it one way or the other? |
I guess I'll bike-shed the name then 😁, perhaps going with
Yes, I can see separating the formally-deprecated/deleted items from just the "nice to do" modernizations being good (such as all the requested intrinsic replacements, or Appendix A of Modern Fortran Explained), so IMO two categories is reasonable for this.
I guess everything is going to be opinionated, but with the configuration files people can create custom rule sets that people could apply to their projects - so then the Fortran-lang projects could just distribute a config file that would activate all those rules that are recommendations from the pages. (I know my plan is to use a configuration file in my repo so I can use that in the CI and control the warnings generated).
I think this discoverability problem can be overcome by prominently documenting the
Yes, this is probably the pain point for growing, but it seems like a band-aid that needs to be ripped off eventually. |
I think the outcome of this discussion and one @LiamPattinson and I have just had offline is that yes, we definitely want to have a more restricted subset of rules turned on by default, but that maybe we leave the reorganisation of categories for now, as there are some |
Closes #306
This is a proposal for a (hopefully) sensible set of default rules where I've moved them into the
bugprone
category. This makes the default rules easy to remember --["E", "B", "OB"]
.Although I've fixed some tests, I've not moved any files around, and some test outputs now include the warning for redirected rules.
Testing this out on real world projects seems to work fine, ignores and selects are all redirected correctly.
One weird side-effect is that the
M
category is now all preview rules, so selecting it will warn it does nothing without enabling preview mode.Perhaps the main downside is that we check fewer rules by default, but it's trivial to reenable everything with
--select=ALL