-
Notifications
You must be signed in to change notification settings - Fork 417
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
Add checkstyle #817
Add checkstyle #817
Conversation
494fec2
to
93812c4
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.
Good work! (;^_^)ッ☆( ゜u゜)
Took me some time to review this... but mostly LGTM, only some minor things:
PS: Also please rebase the PR
extractor/src/main/java/org/schabi/newpipe/extractor/Extractor.java
Outdated
Show resolved
Hide resolved
extractor/src/main/java/org/schabi/newpipe/extractor/linkhandler/ListLinkHandlerFactory.java
Outdated
Show resolved
Hide resolved
extractor/src/main/java/org/schabi/newpipe/extractor/linkhandler/ListLinkHandlerFactory.java
Outdated
Show resolved
Hide resolved
*/ | ||
public TimeAgoParser(PatternsHolder patternsHolder) { | ||
public TimeAgoParser(final PatternsHolder patternsHolder) { |
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.
Note: This class definetly needs a refactoring after we merged this.
extractor/src/main/java/org/schabi/newpipe/extractor/utils/DonationLinkHelper.java
Outdated
Show resolved
Hide resolved
Fixed above problems myself. Note: This PR breaks backwards compatibility with NewPipe → new major/minor release; no patch release + PR at NewPipe required! |
Also remove useless null check on ItagItem.getItag() as that function already throws an exception if there is no itag
Also add comment about the class being unused and replace the fixLink function with Utils.stringToUrl()
Also use Java 8 streams and extract duplicate code to getInstanceOf function
Note: not all issues were fixed because MediaFormat and ServiceList use a specific formatting that makes sense for them
``contentFilters`` and ``sortfilter`` are get inside the ``ListLinkHandler`` and not the ``ListLinkHandlerFactory`` ``ListLinkHandlerFactory`` only passes these values through when ``fromQuery`` is called
Also happens on the dev-Branch → can be ignored |
Do you want to merge this before #810? I would not suggest it. |
@TobiGr |
Current test-results (mock): Reasons:
|
This PR adds checkstyle to the project. The motivation for doing this, and doing it in a single PR is the following: there have been many PRs lately that should fix one thing but while they are at it they also fix the formatting, making it far more difficult to review. That's why from now on any misformatting will be reported as an error (only
test
tasks though, notcompileJava
tasks so that we don't overload Jitpack's servers with useless checkstyle checks).checkstyle.xml
I used is the same as NewPipe minus some Javadoc-related stuff. There is no need for strict rules over comments here in the extractor, as sometimes javadocs are just needed to clarify a small thing and having empty/meaningless @param or @throws is useless.fix-warnings
).After this PR is merged I would propose to BAN any reformatting unrelated to the modified code in extractor PRs, unless the PR contains only reformats. The ways to format things that are not constrained by checkstyle are pretty subjective (e.g. whether to put multiple
.foo().bar().baz()
on the same line or split them), so it does not make sense to keep reformatting them, and in any case it should be done in separate PRs.I hope this PR will be merged soon otherwise... many conflicts to solve ;-)