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

Move trackset-features into library subfolder #2715

Merged
merged 21 commits into from
Jun 11, 2020

Conversation

xeruf
Copy link
Contributor

@xeruf xeruf commented Apr 25, 2020

Follow-up to my previous PR. The second commit is a pure refactor/reformat, no code changes. Tested with SCons & CMake.

@xeruf
Copy link
Contributor Author

xeruf commented Apr 26, 2020

@Be-ing can't request review directly :)

There is the "Triage" role on GitHub now, which would give access to such things, are you using that?

Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

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

Good idea to file a PR before actually changing any code.

Please check the formatting of each file, especially check for long lines. Sometimes you need need to give clang-format a hint to get it right.

src/library/trackset/crate/cratetablemodel.cpp Outdated Show resolved Hide resolved
@xeruf xeruf force-pushed the refactor-basetrackset branch from dee23e9 to 4f840a3 Compare April 26, 2020 12:08
src/library/banshee/bansheeplaylistmodel.cpp Outdated Show resolved Hide resolved
src/library/baseexternalplaylistmodel.cpp Outdated Show resolved Hide resolved
src/library/hiddentablemodel.cpp Outdated Show resolved Hide resolved
@xeruf xeruf requested a review from uklotzde April 26, 2020 12:11
The trailing slashes prevent clang-format from wrapping that text into a big chunk, see:
https://stackoverflow.com/a/34362422
@xeruf xeruf force-pushed the refactor-basetrackset branch from 1d4905f to bbabfad Compare April 26, 2020 19:59
src/library/trackset/baseplaylistfeature.h Outdated Show resolved Hide resolved
src/library/trackset/crate/cratetablemodel.cpp Outdated Show resolved Hide resolved
@daschuer daschuer added this to the 2.4.0 milestone May 4, 2020
@xeruf xeruf force-pushed the refactor-basetrackset branch from 63bf05a to c1a6054 Compare May 19, 2020 10:37
@xeruf xeruf requested review from Holzhaus and daschuer May 19, 2020 10:38
@xeruf
Copy link
Contributor Author

xeruf commented May 19, 2020

I have rebased on master and presumably fixed all mentioned problems :)

src/library/trackmodel.h Outdated Show resolved Hide resolved
src/library/trackset/crate/cratestorage.cpp Outdated Show resolved Hide resolved
src/library/trackset/crate/cratestorage.cpp Outdated Show resolved Hide resolved
src/library/trackset/crate/cratestorage.cpp Outdated Show resolved Hide resolved
src/library/trackset/crate/cratestorage.cpp Outdated Show resolved Hide resolved
src/library/trackset/crate/cratetablemodel.cpp Outdated Show resolved Hide resolved
@xeruf
Copy link
Contributor Author

xeruf commented May 19, 2020

I would like to have this PR merged as there don't seem to any substantial issues left. Deferred tasks:

@Holzhaus please check if I resolved #2715 (comment) correctly

@xeruf xeruf requested a review from Holzhaus May 19, 2020 19:05
Copy link
Member

@Holzhaus Holzhaus left a comment

Choose a reason for hiding this comment

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

Thanks, looks mostly good.

src/library/playlisttablemodel.cpp Outdated Show resolved Hide resolved
src/library/trackset/crate/cratestorage.cpp Outdated Show resolved Hide resolved
src/library/playlisttablemodel.cpp Outdated Show resolved Hide resolved
src/library/librarytablemodel.cpp Outdated Show resolved Hide resolved
.clang-format Outdated Show resolved Hide resolved
src/library/hiddentablemodel.cpp Outdated Show resolved Hide resolved
.clang-format Outdated Show resolved Hide resolved
@xeruf xeruf requested review from uklotzde and Holzhaus May 21, 2020 09:45
@xeruf xeruf force-pushed the refactor-basetrackset branch from 694ee97 to bd4a67d Compare May 21, 2020 12:08
@xeruf
Copy link
Contributor Author

xeruf commented May 21, 2020

@Holzhaus all should be fixed now - again, please check above (#2715 (comment)) if I did it correctly and resolve the comment

Comment on lines 31 to 32
return QStringLiteral("%1 (%2) %3")
.arg(
Copy link
Member

Choose a reason for hiding this comment

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

Does QStringLiteral actually work with .arg()? I remember I tried that once and it didn't work...

Copy link
Contributor

Choose a reason for hiding this comment

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

I can confirm that it does work and also remember that it didn't previously. Maybe switching to QStringBuilder did the trick?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tests are all succeeding, and I hope there is at least some testing covering the library. I changed this in so many places that it would be shocking if it wouldn't work and the tests would still succeed.

@Holzhaus
Copy link
Member

There are some remaining style issues.
I recommend to use the pre-commit hook, to avoid future style discussions.

I USE CLANG-FORMAT! ALL THE TIME!

Sorry, but I can't take this anymore. For days almost all comments have been about issues of clang-format that I'm supposed to manually correct. I have better things to do.
Please either merge my PR as is or refrain from any style comments until you have adjusted it to actually produce the style you want. I can also look into that, but so far my suggestions about config changes haven't been well received.

pre-commit != clang-format. Please use the pre-commit hook, not just clang-format.
These hooks actually run clang-format twice: The first time it runs clang-format, the second time runs clang-format again with slightly different settings and only on long lines.

I didn't have any issues with formatting when using pre-commit. If you're are actually using that and it still doesn't format code correctly that's a bug and needs to be fixed.

@xeruf
Copy link
Contributor Author

xeruf commented May 22, 2020

pre-commit != clang-format. Please use the pre-commit hook, not just clang-format.
These hooks actually run clang-format twice: The first time it runs clang-format, the second time runs clang-format again with slightly different settings and only on long lines.

Thanks for the clarification! I assumed it would simply run clang-format.

Made that more clear on the wiki: https://www.mixxx.org/wiki/doku.php/coding_guidelines#pre-commit

@xeruf
Copy link
Contributor Author

xeruf commented May 22, 2020

I ran pre-commit over src/library/library.cpp and the whole src/library folder using git ls-files -- "src/library" | xargs pre-commit run --files` - nothing changed...

And no, I'm not doing a rebase. I just tried and ended up with horrible conflicts.

@uklotzde
Copy link
Contributor

No need to delay this PR further due to code style discussions. We have identified some shortcomings of clang-format for multi-line string literals that could be resolved later.

@daschuer
Copy link
Member

daschuer commented May 23, 2020

I am sorry to stress this formatting issue that much.
But vertical scrolling during a review is a no go for me.

I think the PR got to this state, because you probably have messed around with clang format during development.
Luckily this reveals an issue with our CI clang-format test on Travis.
I have added a PR that aims to fix it.
#2816

Now you have three options to continue here:

  1. git rebase -i upstream/master
    and amend each commit with the pre-commit hook changes.
git pull https://github.com/daschuer/mixxx.git pre-commit-clang
pre-commit run --source upstream/master --origin HEAD
git commit -a
git commit -a
  1. Merge
    clang-format xeruf/mixxx#3

@xeruf
Copy link
Contributor Author

xeruf commented May 23, 2020

@daschuer I am leaning towards option 3, but this WILL create conflicts with my follow-up PR that I've already started working on because this took so long, which I am not fond of either...

Also, I am seeing quite a few things in there that make the code less readable...

@xeruf
Copy link
Contributor Author

xeruf commented May 23, 2020

It's not as if I explicitly created new long lines. All the lines that got longer where solely because of clang-format. For the lines I worked on by hand I always checked the length.

I think the hard-wrap should leave a little buffer (maybe at 100), because sometimes a line needs to be a little longer to stay readable.

xeruf#3 (review)
Here a few comments on wrongs of the formatter

@xeruf
Copy link
Contributor Author

xeruf commented May 23, 2020

I think the PR got to this state, because you probably have messed around with clang format during development.

Nope, I didn't mess around. I have configured my IDE to automatically run clang-format on files I work on, if that doesn't produce the correct coding style without the pre-commit hook, it should be adjusted. There was only one option I tried, which was AlwaysBreakBeforeMultilineStrings: true and didn't make much of a difference.

@daschuer
Copy link
Member

I am leaning towards option 3, but this WILL create conflicts with my follow-up PR that I've already started working on because this took so long, which I am not fond of either...

OK so go ahead. Since the clang-format commit does not change the code, the conflicts should be easy to solve.

@xeruf xeruf requested review from uklotzde, daschuer and Holzhaus May 30, 2020 14:59
@xeruf
Copy link
Contributor Author

xeruf commented May 30, 2020

Alright, I hope we are finally done here 😅

@Holzhaus
Copy link
Member

Holzhaus commented Jun 4, 2020

Some merge conflicts have emerged.

@xeruf
Copy link
Contributor Author

xeruf commented Jun 5, 2020

Me: Creates PR
Community: Reviews PR
Me: Let's merge
Community: First, let's fix the code style
Me: Okay, but let's finally merge!
Github: A wild conflict has appeared!
😅

@xeruf
Copy link
Contributor Author

xeruf commented Jun 5, 2020

Fixed, was merely about imports :)

@xeruf
Copy link
Contributor Author

xeruf commented Jun 11, 2020

@Holzhaus please merge, before more things appear :)

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

LGTM, Thank you. And sorry for all the hassle.

Copy link
Member

@Holzhaus Holzhaus left a comment

Choose a reason for hiding this comment

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

LGTM

@Holzhaus Holzhaus merged commit 2ea349e into mixxxdj:master Jun 11, 2020
@xeruf xeruf deleted the refactor-basetrackset branch June 12, 2020 12:54
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.

5 participants