From 494fec2ca117a38170fd0557b99c3a4c95147373 Mon Sep 17 00:00:00 2001 From: Stypox Date: Sat, 19 Mar 2022 00:02:57 +0100 Subject: [PATCH] Legitimately suppress remaining checkstyle warnings --- checkstyle/suppressions.xml | 15 +++++++++++++++ .../org/schabi/newpipe/extractor/MediaFormat.java | 1 + .../org/schabi/newpipe/extractor/ServiceList.java | 1 + .../youtube/YoutubeThrottlingDecrypter.java | 4 ++-- .../extractors/YoutubeMusicSearchExtractor.java | 1 + .../YoutubeStreamLinkHandlerFactory.java | 1 + .../newpipe/extractor/stream/StreamInfo.java | 1 + 7 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 checkstyle/suppressions.xml diff --git a/checkstyle/suppressions.xml b/checkstyle/suppressions.xml new file mode 100644 index 0000000000..e51dee8f41 --- /dev/null +++ b/checkstyle/suppressions.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/MediaFormat.java b/extractor/src/main/java/org/schabi/newpipe/extractor/MediaFormat.java index 5836f5b8f1..4423068488 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/MediaFormat.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/MediaFormat.java @@ -29,6 +29,7 @@ * Static data about various media formats support by NewPipe, eg mime type, extension */ +@SuppressWarnings("MethodParamPad") // we want the media format table below to be aligned public enum MediaFormat { // @formatter:off //video and audio combined formats diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/ServiceList.java b/extractor/src/main/java/org/schabi/newpipe/extractor/ServiceList.java index 5bfc5692f3..18c617f659 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/ServiceList.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/ServiceList.java @@ -31,6 +31,7 @@ /** * A list of supported services. */ +@SuppressWarnings({"ConstantName", "InnerAssignment"}) // keep unusual names and inner assignments public final class ServiceList { private ServiceList() { //no instance diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingDecrypter.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingDecrypter.java index ce4241f1c4..369cb6ab21 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingDecrypter.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingDecrypter.java @@ -39,8 +39,8 @@ public class YoutubeThrottlingDecrypter { "b=a\\.get\\(\"n\"\\)\\)&&\\(b=(\\S+)\\(b\\),a\\.set\\(\"n\",b\\)"); private static final Map N_PARAMS_CACHE = new HashMap<>(); - private static String FUNCTION; - private static String FUNCTION_NAME; + @SuppressWarnings("StaticVariableName") private static String FUNCTION; + @SuppressWarnings("StaticVariableName") private static String FUNCTION_NAME; private final String functionName; private final String function; diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMusicSearchExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMusicSearchExtractor.java index a633fbab34..7842f789c7 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMusicSearchExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMusicSearchExtractor.java @@ -279,6 +279,7 @@ public InfoItemsPage getPage(final Page page) return new InfoItemsPage<>(collector, getNextPageFrom(continuations)); } + @SuppressWarnings("MethodLength") private void collectMusicStreamsFrom(final InfoItemsSearchCollector collector, @Nonnull final JsonArray videos) { final TimeAgoParser timeAgoParser = getTimeAgoParser(); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java index 302bdd63d6..d302575306 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java @@ -81,6 +81,7 @@ public String getUrl(final String id) { return "https://www.youtube.com/watch?v=" + id; } + @SuppressWarnings("AvoidNestedBlocks") @Override public String getId(final String theUrlString) throws ParsingException, IllegalArgumentException { diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java index d2caa9c891..fd5a55d755 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java @@ -211,6 +211,7 @@ private static void extractStreams(final StreamInfo streamInfo, final StreamExtr } } + @SuppressWarnings("MethodLength") private static void extractOptionalData(final StreamInfo streamInfo, final StreamExtractor extractor) { /* ---- optional data goes here: ---- */