-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Clang tools testing #5948
Clang tools testing #5948
Conversation
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Windows
Linux
macOS🤖{"platform_name_to_artifacts": {"Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://14454-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.82%2Bga6a09454f-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/14454?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://14452-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.82%2Bga6a09454f-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/14452?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://14453-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.82%2Bga6a0945-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/14453?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://14456-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.82%2Bga6a09454f-mac10.14.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/14456?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "c7424137f6f6d25aab1b7f905f9d20c44df62abf"} |
0c66a64
to
551c818
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some glances around and comments on format
Is it easy to change the clang format to use |
Preparation for clang-format. It will shuffle the includes, and this preparation will prevent errors from that step.
This enables files for checking against the [LMMS coding conventions](https://github.com/LMMS/lmms/wiki/Coding-conventions). There is no strategy for automatic testing yet.
This commit was created by solely running ``` clang-format -style=file -i $(git ls-files '*.cpp' '*.h') git commit -a ``` No functional changes.
No matter what I configure (different break styles, different columnlimit), I always get auto controllerType = m_controllerConnection
- ? m_controllerConnection->getController()->type()
- : Controller::DummyController;
- bool skipMidiController = Engine::getSong()->isSavingProject()
- && Engine::getSong()->getSaveOptions().discardMIDIConnections.value();
- if (m_controllerConnection && controllerType != Controller::DummyController
- && !(skipMidiController && controllerType == Controller::MidiController))
+ ? m_controllerConnection->getController()->type()
+ : Controller::DummyController;
+ bool skipMidiController = Engine::getSong()->isSavingProject() && Engine::getSong()->getSaveOptions().discardMIDIConnections.value();
+ if (m_controllerConnection && controllerType != Controller::DummyController && !(skipMidiController && controllerType == Controller::MidiController))
{
|
551c818
to
4c22a30
Compare
To fix the bool and if statements we can try:
For the ternary operator:
|
@Veratil Thanks for the hint! That worked in some lines, but not in the marked line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just scrolled to a random spot to have a look. Looks a lot cleaner from the little I saw.
#include "gui_templates.h" | ||
|
||
#define makeknob( name, x, y, model, label, hint, unit ) \ | ||
Knob * name = new Knob( knobBright_26, this); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a heads up, any tabs formatting line-continuation characters in multi-line #define
's to be in a single "column" are reduced to being only a single space after the line. I'm ambivalent to either style but wanted to bring it up.
Have we ever done a poll on bracket style? I feel like it would make sense to include that in this if it's going to be changed. I think this covers the common styles, correct me if something's missing: // Heart
if (gum)
{
chew(gum);
}
else
{
doTheOtherThing();
}
// Rocket
if (gum) {
chew(gum);
}
else {
doTheOtherThing();
}
// Eye
if (gum) {
chew(gum);
} else {
doTheOtherThing();
} |
Looks like 👁️ is preferred. @Spekular can you please fill out
And reply how you think it should be, in your opinion? |
First of all, many thanks for the feedback on the PR. Many of the comments can be resolved by using
which has been accepted (4 times) on Discord. |
If they are smaller than ColumnLimit (120), it is packed into one line. If not, it remains unchanged.
My only concern with these settings is that in some of the examples disabling wrapping seems to disable indentation inside the brackets, or there's no indent in the first place. I'm using https://clang.llvm.org/docs/ClangFormatStyleOptions.html for reference. AfterExternBlock:
AfterNamespace
If these examples are the only options I would say |
Agreed, I set this to false, too. It looks strange to me if class braces are not wrapped, but enum braces are.
That seems true for
In many cases,
Yes, tested, this has no effect on the whole source. Summary: I take it like you filled it out, except that I set it to |
Note: I only ran clang-format for the first pass. I'll run clang-tidy if the changes here are accepted by everyone. Note to self: You need to run |
What I mean is, in the documentation it looks like "true" provides unwrapped braces and "false" provides wrapped ones, as opposed to all other settings. I still want classes to look like this:
As for namespace and extern, I'll trust your judgement on those. |
Oh, that's a documentation error at their example for |
All comments that marked negative aspects of
I'm not sad if anyone votes for ❤️ . Please simply vote what you think applies most. |
plugins/vst_base/RemoteVstPlugin.cpp
Outdated
|
||
if (!chunky) delete[] data; | ||
delete[](sBank*) pBank; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Affected by llvm/llvm-project#53576
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grepping our whole code base, it's only 6 occurrences in the mentioned file, so I think we can do this inconsistent for now and possibly fix it after reorg.
Deprecated by #6323 (and merged there). |
This is not intended to be merged (I'll do a new branch for the official). The intention is to
Rebasing your branch on this might work like this for single-commit branches:
clang-format -style=file -i $(git ls-files '*.cpp' '*.h')
git commit -am 'fixup'
git rebase -i HEAD~2
, Chooesef
for the second commit, accept.git rebase clang-formatted
This is a testing brach for #4690 .