Details
- Reviewers
aaron.ballman angelgarcia alexfh - Commits
- rGbcf23661d08a: [clang-tidy] Rename modernize-use-default to modernize-use-equals-default
rCTE288375: [clang-tidy] Rename modernize-use-default to modernize-use-equals-default
rL288375: [clang-tidy] Rename modernize-use-default to modernize-use-equals-default
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tidy/modernize/ModernizeTidyModule.cpp | ||
---|---|---|
58 ↗ | (On Diff #77502) | What do we want to do, if anything, for people who have scripts using the old name? Do we want to keep the old name as an alias to the new name for some period of time? |
clang-tidy/modernize/ModernizeTidyModule.cpp | ||
---|---|---|
58 ↗ | (On Diff #77502) | An alias helps if the check was enabled by name, but not if it was disabled by name. |
clang-tidy/modernize/ModernizeTidyModule.cpp | ||
---|---|---|
58 ↗ | (On Diff #77502) |
Oye, this is true and unfortunate.
I think a deprecation warning would be a helpful feature, but not required. I do agree that I would not want a warning for wildcard matches. I would also be fine if we simply had the documentation for modernize-use-default forward to the documentation for modernize-use-equals-default and put a note in there about the old name being deprecated and leave in an alias to the old name. To be complete, I would also be fine if we remove the old name as in this patch. I am mostly thinking about what default policy we want to have when this situation arises. FWIW, the check was exposed under this name around Oct 2015, so it's been in the wild for over a year, and in a public release. |
I think this change is not required at first place.
It is introduced because of "modernize-use-delete" was too ambiguous because of operator delete, so it was changed to "modernize-use-equals-delete". But this case is not ambiguous at all, so I don't see point changing that.
Maybe it would be better to find better name for the modernize-use-equals-delete to be modernize-delete-function or something before 4.0 is released.
Also, "default" has meaning in English, so it's plausible to read this as a check that modernizes your code to "use the default" for whatever the user might be thinking of when they enable the check, so I think there is existing ambiguity with the current name.
clang-tidy/modernize/ModernizeTidyModule.cpp | ||
---|---|---|
58 ↗ | (On Diff #77502) | I'd personally prefer to leave the old documentation file with a redirect and a note about the renaming. Similar to how we treat aliases. WDYT? |
clang-tidy/modernize/ModernizeTidyModule.cpp | ||
---|---|---|
58 ↗ | (On Diff #77502) | If it has a redirect then add_new_check.py will add it to list.rst using the same wording as an alias. |
clang-tidy/modernize/ModernizeTidyModule.cpp | ||
---|---|---|
58 ↗ | (On Diff #77502) | I don't care about leaving the old name for the check (probably, better to remove it right away), but leaving the old documentation page with a proper redirect seems useful as a means to resolve users' confusion. I wouldn't call it "alias" in this case though, and including it to the list doesn't seem to be useful (so the document will need to be marked orphan, IIUC). |
clang-tidy/modernize/ModernizeTidyModule.cpp | ||
---|---|---|
58 ↗ | (On Diff #77502) | (So, we can do something close to clang/tools/extra/docs/clang-tidy.rst) |
Add documentation redirect.
Change add_new_check.py to ignore checks that are orphaned.