Skip to content
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

CI: Remove readability-identifier-length check #18403

Merged

Conversation

chennes
Copy link
Member

@chennes chennes commented Dec 9, 2024

As discussed in the PR Review Meeting this morning, this removes the readability-identifier-length automated check, which creates more noise than it is worth. We plan to instead rely on code reviewers to encourage good variable naming, which will often (though not always) include using longer names.

@chennes chennes force-pushed the clangTidyRemoveReadabilityIdentifierLength branch from bb7116e to a182904 Compare December 9, 2024 22:27
@bofdahof
Copy link

IMO This is a bad move.

clang-tidy checks warnings exist precisely to warn of bad practises.

To say "creates more noise than it is worth" and turn them off is to say "no longer important - we don't care".

To go on and say "rely on code reviewers" is to justify something already decided unimportant becoming a nit-pick review opportunity. And nit-pick reviews are always bad.

@kadet1090
Copy link
Member

kadet1090 commented Dec 11, 2024

This is not disabling the clang tidy, only one specific rule that is about short variable names. While usually this check is useful FreeCAD has quite a lot to do with math symbols - we often have variables like: x, y, z, t, u etc which really have no better name often. This check is very often a false positive and can be against common sense. In such case it is better to rely on reviewer to judge based on context where name like t is fine and where it is not.

@bofdahof
Copy link

x, y, z, t, u etc which really have no better name often

Ignores the fact that the clang-tidy warning exists to remind that single character variables are hard to see, easy to misread etc etc, regardless of where they are used.

Whilst it was the habit in the past to use single chars for some situations, that is IMO hardly an excuse to just ignore the problem when laziness suits. Need to set the goalposts just a little higher.

@chennes
Copy link
Member Author

chennes commented Dec 13, 2024

@adrianinsaval or @yorikvanhavre you want to weigh in and either merge or not? The consensus in today's PR review meeting was that removing this check is a good thing to do (nine attendees, none objecting).

@adrianinsaval
Copy link
Member

Looks good to me, if we know specifically which letters are ok as names it looks like we could add them as exceptions if that's more desirable. I'll go ahead and merge this, it can be added back if people feel like we need it

@adrianinsaval adrianinsaval merged commit 032a701 into FreeCAD:main Dec 13, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants