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

feat: use clang-tidy lint readability-identifier-naming #13642

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

Swiftb0y
Copy link
Member

@Swiftb0y Swiftb0y commented Sep 9, 2024

This is a best effort attempt to encode our naming rules in clang-tidy. This obviously creates a lot of warnings and we need to decide on how to resolve them. should I just go through in fix them all, risking merge conflicts?

@daschuer
Copy link
Member

daschuer commented Sep 9, 2024

This is still all green, but there are 10 warnings. Not sure if clang tidy gives up at some point?
Is there a way to check only the diff or touched files? In such a way it is very useful and can even be an error.

Fixing all occurrences and the required review and merge conflicts is a waste of time IMHO. We can better make use of the time implementing a new features.

@Swiftb0y
Copy link
Member Author

This is still all green, but there are 10 warnings.

Why only 10? I do see loads of warnings once I unfold the build log (including ones warning about faulty configs, my mistake).

Is there a way to check only the diff or touched files? In such a way it is very useful and can even be an error.

Not sure, I can look into it but I don't think there is (since clang-tidy is a built tool and likely has no concept of git). Github itself however does put the warnings into the "files changed" tab directly at the right location during review. So at least it should be noticeable during review without being too distracting.

@Swiftb0y
Copy link
Member Author

I added a script that runs clang-tidy on the diff pre-commit. that also allows us to remove the clang-tidy CI which is a waste of energy anyways.

@Swiftb0y
Copy link
Member Author

So this technically works now. I'd like to get some feedback on this first before I bother with doing the CI env properly.

@daschuer
Copy link
Member

daschuer commented Sep 10, 2024

Why only 10?

Ah. It seems to be the limit of the GitHub parser. The issue is that we will be dragged away from important warnings if we see only 10 of these renaming warnings.

So we may wrap clang-tidy and filter the untouched lines. Something like "clang-tidy-diff.py" that calls git and clang-tidy.y and maybe uses also the dependcy info of the make/ninja. A small fun project ??

@daschuer
Copy link
Member

Oh I see you have a different solution. This is interesting. Do we still have the option to check all lines from time to time without readability-identifier-naming. Or is it no longer required?

@Swiftb0y
Copy link
Member Author

Do we still have the option to check all lines from time to time without readability-identifier-naming.

Well, you can just remove the check from the config and run clang-tidy manually. Now that clang-tidy only complains about the diff, I'm planning on enabling a lot more checks since those are generally useful and have just previously been unfeasible for our large codebase at once.

Copy link

This PR is marked as stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the stale Stale issues that haven't been updated for a long time. label Jan 13, 2025
@@ -36,6 +33,34 @@ jobs:
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
git config --global --list
- name: Install build dependencies
run: tools/debian_buildenv.sh setup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a quite costly operation IMO - how do you feel about updating the Docker image instead? Note that would could also make the container in #14018 pushed in GHCR and reuse it in our CI? It may actually be quite good as we could use it build (Ubuntu) as well and a save a significant amount of bandwidth/resource consumption

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I agree. this was just a quick and dirty PoC that has stalled now (because of issues like these). Updating the docker would def. be preferred.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mixxxdj/developers any objection in me extending the scope of #14018 and publish devcontainer in Mixxx GHCR repo?

@github-actions github-actions bot removed the stale Stale issues that haven't been updated for a long time. label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants