├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── static └── images │ ├── add-repository-1.png │ └── add-repository-2.png ├── gradle.properties ├── .gitignore ├── src ├── main │ ├── resources │ │ └── messages │ │ │ └── CodeNarcBundle.properties │ └── java │ │ └── org │ │ └── codenarc │ │ └── idea │ │ ├── Utils.java │ │ ├── quickfix │ │ ├── ReusableIntention.java │ │ ├── DeleteElementQuickFix.java │ │ ├── ConvertGStringToStringReusableIntention.java │ │ ├── ReplacePrintlnWithAnnotationFix.java │ │ ├── AddExplicitReturnQuickFix.java │ │ └── ReplaceStatementFix.java │ │ ├── CodeNarcBundle.java │ │ └── inspections │ │ ├── imports │ │ ├── DuplicateImportInspectionTool.java │ │ ├── ImportFromSamePackageInspectionTool.java │ │ ├── UnnecessaryGroovyImportInspectionTool.java │ │ ├── UnusedImportInspectionTool.java │ │ └── MisorderedStaticImportsInspectionTool.java │ │ ├── formatting │ │ ├── TrailingWhitespaceInspectionTool.java │ │ ├── ConsecutiveBlankLinesInspectionTool.java │ │ ├── BlankLineBeforePackageInspectionTool.java │ │ ├── FileEndsWithoutNewlineInspectionTool.java │ │ ├── MissingBlankLineAfterImportsInspectionTool.java │ │ ├── MissingBlankLineAfterPackageInspectionTool.java │ │ ├── BracesForClassInspectionTool.java │ │ ├── SpaceAfterIfInspectionTool.java │ │ ├── SpaceAfterForInspectionTool.java │ │ ├── SpaceAfterCatchInspectionTool.java │ │ ├── SpaceAfterCommaInspectionTool.java │ │ └── SpaceAfterWhileInspectionTool.java │ │ ├── comments │ │ ├── JavadocEmptyFirstLineInspectionTool.java │ │ ├── SpaceAfterCommentDelimiterInspectionTool.java │ │ ├── SpaceBeforeCommentDelimiterInspectionTool.java │ │ └── ClassJavadocInspectionTool.java │ │ ├── naming │ │ ├── ClassNameSameAsFilenameInspectionTool.java │ │ └── PackageNameMatchesFilePathInspectionTool.java │ │ ├── generic │ │ ├── IllegalRegexInspectionTool.java │ │ ├── RequiredRegexInspectionTool.java │ │ ├── IllegalStringInspectionTool.java │ │ └── RequiredStringInspectionTool.java │ │ ├── convention │ │ ├── NoTabCharacterInspectionTool.java │ │ ├── NoDefInspectionTool.java │ │ ├── NoFloatInspectionTool.java │ │ ├── NoDoubleInspectionTool.java │ │ ├── CouldBeElvisInspectionTool.java │ │ ├── CompileStaticInspectionTool.java │ │ ├── InvertedIfElseInspectionTool.java │ │ └── NoJavaUtilDateInspectionTool.java │ │ ├── basic │ │ ├── DeadCodeInspectionTool.java │ │ ├── EmptyClassInspectionTool.java │ │ ├── EmptyMethodInspectionTool.java │ │ ├── ClassForNameInspectionTool.java │ │ ├── EmptyTryBlockInspectionTool.java │ │ ├── DoubleNegativeInspectionTool.java │ │ ├── EmptyElseBlockInspectionTool.java │ │ ├── BrokenNullCheckInspectionTool.java │ │ ├── DuplicateMapKeyInspectionTool.java │ │ ├── RemoveAllOnSelfInspectionTool.java │ │ ├── EmptyIfStatementInspectionTool.java │ │ ├── EqualsOverloadedInspectionTool.java │ │ ├── BooleanGetBooleanInspectionTool.java │ │ ├── DuplicateSetValueInspectionTool.java │ │ ├── EmptyFinallyBlockInspectionTool.java │ │ ├── EmptyForStatementInspectionTool.java │ │ ├── EqualsAndHashCodeInspectionTool.java │ │ ├── IntegerGetIntegerInspectionTool.java │ │ ├── BrokenOddnessCheckInspectionTool.java │ │ ├── ComparisonWithSelfInspectionTool.java │ │ └── EmptyWhileStatementInspectionTool.java │ │ ├── junit │ │ ├── ChainedTestInspectionTool.java │ │ ├── JUnitLostTestInspectionTool.java │ │ ├── CoupledTestCaseInspectionTool.java │ │ ├── UnnecessaryFailInspectionTool.java │ │ └── JUnitPublicFieldInspectionTool.java │ │ ├── unused │ │ ├── UnusedArrayInspectionTool.java │ │ └── UnusedObjectInspectionTool.java │ │ ├── concurrency │ │ ├── BusyWaitInspectionTool.java │ │ ├── ThreadGroupInspectionTool.java │ │ └── ThreadYieldInspectionTool.java │ │ ├── security │ │ ├── SystemExitInspectionTool.java │ │ ├── InsecureRandomInspectionTool.java │ │ └── ObjectFinalizeInspectionTool.java │ │ ├── design │ │ ├── NestedForLoopInspectionTool.java │ │ ├── OptionalFieldInspectionTool.java │ │ └── LocaleSetDefaultInspectionTool.java │ │ ├── exceptions │ │ ├── CatchErrorInspectionTool.java │ │ ├── ThrowErrorInspectionTool.java │ │ ├── CatchExceptionInspectionTool.java │ │ ├── CatchThrowableInspectionTool.java │ │ ├── ThrowExceptionInspectionTool.java │ │ └── ThrowThrowableInspectionTool.java │ │ ├── logging │ │ ├── SystemErrPrintInspectionTool.java │ │ ├── SystemOutPrintInspectionTool.java │ │ ├── MultipleLoggersInspectionTool.java │ │ └── PrintStackTraceInspectionTool.java │ │ ├── groovyism │ │ ├── UseCollectManyInspectionTool.java │ │ ├── GStringAsMapKeyInspectionTool.java │ │ └── UseCollectNestedInspectionTool.java │ │ ├── braces │ │ ├── IfStatementBracesInspectionTool.java │ │ └── ForStatementBracesInspectionTool.java │ │ ├── dry │ │ ├── DuplicateMapLiteralInspectionTool.java │ │ └── DuplicateListLiteralInspectionTool.java │ │ ├── jenkins │ │ └── ClosureInGStringInspectionTool.java │ │ └── unnecessary │ │ └── AddEmptyStringInspectionTool.java └── test │ ├── groovy │ └── org │ │ └── codenarc │ │ └── idea │ │ ├── testing │ │ ├── package-info.java │ │ ├── TestLibrary.java │ │ ├── CompoundTestLibrary.java │ │ └── LibraryLightProjectDescriptor.java │ │ └── inspections │ │ ├── logging │ │ └── PrintlnInspectionToolSpec.groovy │ │ ├── unnecessary │ │ ├── UnnecessaryGStringInspectionToolSpec.groovy │ │ └── UnnecessaryDotClassInspectionToolSpec.groovy │ │ ├── groovyism │ │ ├── AssignCollectionSortInspectionToolSpec.groovy │ │ └── AssignCollectionUniqueInspectionToolSpec.groovy │ │ ├── basic │ │ └── AssignmentInConditionalInspectionToolSpec.groovy │ │ ├── convention │ │ └── ImplicitReturnStatementInspectionToolSpec.groovy │ │ └── imports │ │ ├── NoWildcardImportsInspectionToolSpec.groovy │ │ └── UnusedImportInspectionToolSpec.groovy │ └── resources │ └── org │ └── codenarc │ └── idea │ └── inspections │ ├── logging │ └── PrintlnInspectionToolSpec │ │ ├── fixed.txt │ │ └── before.txt │ ├── unnecessary │ ├── UnnecessaryGStringInspectionToolSpec │ │ ├── fixed.txt │ │ └── before.txt │ └── UnnecessaryDotClassInspectionToolSpec │ │ ├── fixed.txt │ │ └── before.txt │ ├── imports │ ├── UnusedImportInspectionToolSpec │ │ ├── fixed.txt │ │ └── before.txt │ └── NoWildcardImportsInspectionToolSpec │ │ ├── fixed.txt │ │ └── before.txt │ ├── convention │ └── ImplicitReturnStatementInspectionToolSpec │ │ ├── fixed.txt │ │ └── before.txt │ ├── groovyism │ ├── AssignCollectionSortInspectionToolSpec │ │ ├── fixed.txt │ │ └── before.txt │ └── AssignCollectionUniqueInspectionToolSpec │ │ ├── fixed.txt │ │ └── before.txt │ └── basic │ └── AssignmentInConditionalInspectionToolSpec │ ├── fixed.txt │ └── before.txt ├── description.html ├── .github └── workflows │ ├── gradle.yml │ ├── release.yml │ └── beta_release.yml └── .run └── codenarc-idea [runIde].run.xml /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'codenarc-idea' 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melix/codenarc-idea/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /static/images/add-repository-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melix/codenarc-idea/HEAD/static/images/add-repository-1.png -------------------------------------------------------------------------------- /static/images/add-repository-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melix/codenarc-idea/HEAD/static/images/add-repository-2.png -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | ideVersion=2025.3 2 | pluginVersion=7.0.9 3 | codenarcVersion=3.7.0-groovy-4.0 4 | groovyVersion=4.0.29 5 | spockVersion=2.3-groovy-4.0 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | \.idea/ 2 | out/ 3 | 4 | CodeNarc Updated\.zip 5 | 6 | .gradle/ 7 | 8 | atlassian-ide-plugin.xml 9 | 10 | *.iml 11 | 12 | build/ 13 | bin/ 14 | lib/ 15 | \.intellijPlatform/ -------------------------------------------------------------------------------- /src/main/resources/messages/CodeNarcBundle.properties: -------------------------------------------------------------------------------- 1 | add.explicit.return=Add explicit return statement 2 | add.modifier=Add {0} modifier 3 | replace.text=Replace {0} with {1} 4 | use.logging.instead.of.println=Use Slf4j instead of println 5 | -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/testing/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Contains classes from https://github.com/JetBrains/intellij-community/tree/master/plugins/groovy/test/org/jetbrains/plugins/groovy 3 | */ 4 | package org.codenarc.idea.testing; 5 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/logging/PrintlnInspectionToolSpec/fixed.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | import groovy.util.logging.Slf4j 4 | 5 | @Slf4j 6 | class Snippet { 7 | 8 | void someMethod() { 9 | log.info 'Hello' 10 | log.info 'World' 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /description.html: -------------------------------------------------------------------------------- 1 | CodeNarc analyzes Groovy code for defects, bad practices, inconsistencies, style issues and more. 2 | A flexible framework for rules, rulesets and custom rules means it's easy to configure CodeNarc to 3 | fit into your project. Build tool, framework support, and report generation are all enterprise ready. 4 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/unnecessary/UnnecessaryGStringInspectionToolSpec/fixed.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | class UnnecessaryGString { 4 | 5 | void someMethod() { 6 | def something = 'Should be single quote' 7 | def other = 'Should be single quote as well' 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionSha256Sum=16f2b95838c1ddcf7242b1c39e7bbbb43c842f1f1a1a0dc4959b6d4d68abcac3 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-all.zip 5 | networkTimeout=10000 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/logging/PrintlnInspectionToolSpec/before.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | class Snippet { 4 | 5 | void someMethod() { 6 | println 'Hello' 7 | println 'World' 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/imports/UnusedImportInspectionToolSpec/fixed.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | 4 | /** 5 | * Class to demonstrate code violations. Files before.txt and fixed.txt 6 | * are only generated when missing so you need to delete these files if you want to regenerated them. 7 | */ 8 | class UnusedImportInspectionToolSpecSnippet { 9 | 10 | void doSomething() { } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/inspections/logging/PrintlnInspectionToolSpec.groovy: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.logging 2 | 3 | import com.intellij.codeInspection.LocalInspectionTool 4 | import org.codenarc.idea.testing.InspectionSpec 5 | 6 | class PrintlnInspectionToolSpec extends InspectionSpec { 7 | 8 | @Override 9 | protected LocalInspectionTool createInspection() { 10 | return new PrintlnInspectionTool() 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/unnecessary/UnnecessaryDotClassInspectionToolSpec/fixed.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | /** 4 | * Class to demonstrate code violations. Files before.txt and fixed.txt 5 | * are only generated when missing so you need to delete these files if you want to regenerated them. 6 | */ 7 | class UnnecessaryDotClassInspectionToolSpecSnippet { 8 | 9 | void doSomething() { 10 | def one = String 11 | def two = String 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/inspections/unnecessary/UnnecessaryGStringInspectionToolSpec.groovy: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.unnecessary 2 | 3 | import com.intellij.codeInspection.LocalInspectionTool 4 | import groovy.transform.CompileDynamic 5 | import org.codenarc.idea.testing.InspectionSpec 6 | 7 | @CompileDynamic 8 | class UnnecessaryGStringInspectionToolSpec extends InspectionSpec { 9 | 10 | @Override 11 | protected LocalInspectionTool createInspection() { 12 | return new UnnecessaryGStringInspectionTool() 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/convention/ImplicitReturnStatementInspectionToolSpec/fixed.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | /** 4 | * Class to demonstrate code violations. Files before.txt and fixed.txt 5 | * are only generated when missing so you need to delete these files if you want to regenerated them. 6 | */ 7 | class ImplicitReturnStatementInspectionToolSpecSnippet { 8 | 9 | String doSomething() { 10 | return 'something' 11 | } 12 | 13 | String doStuff() { 14 | return 'stuff' 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/groovyism/AssignCollectionSortInspectionToolSpec/fixed.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | /** 4 | * Class to demonstrate code violations. before.txt and fixed.txt 5 | * files are only generated when missing so you need to delete these files if you want to regenerated them. 6 | */ 7 | class AssignCollectionSortInspectionToolSpecSnippet { 8 | 9 | void doSomething() { 10 | List one = ['foo', 'bar'] 11 | List sorted1 = one.sort(false) 12 | List sorted2 = one.sort(false) 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/unnecessary/UnnecessaryGStringInspectionToolSpec/before.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | class UnnecessaryGString { 4 | 5 | void someMethod() { 6 | def something = "Should be single quote" 7 | def other = "Should be single quote as well" 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/groovyism/AssignCollectionUniqueInspectionToolSpec/fixed.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | /** 4 | * Class to demonstrate code violations. before.txt and fixed.txt 5 | * files are only generated when missing so you need to delete these files if you want to regenerated them. 6 | */ 7 | class AssignCollectionUniqueInspectionToolSpecSnippet { 8 | 9 | void doSomething() { 10 | List one = ['foo', 'bar'] 11 | List unique1 = one.unique(false) 12 | List unique2 = one.unique(false) 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/inspections/groovyism/AssignCollectionSortInspectionToolSpec.groovy: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.groovyism 2 | 3 | import com.intellij.codeInspection.LocalInspectionTool 4 | import org.codenarc.idea.testing.InspectionSpec 5 | 6 | class AssignCollectionSortInspectionToolSpec extends InspectionSpec { 7 | 8 | @Override 9 | protected LocalInspectionTool createInspection() { 10 | return new AssignCollectionSortInspectionTool() 11 | } 12 | 13 | @Override 14 | protected Iterable getClassesToInclude() { 15 | return Collections.singleton(JAVA_UTIL_LIST) 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/unnecessary/UnnecessaryDotClassInspectionToolSpec/before.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | /** 4 | * Class to demonstrate code violations. Files before.txt and fixed.txt 5 | * are only generated when missing so you need to delete these files if you want to regenerated them. 6 | */ 7 | class UnnecessaryDotClassInspectionToolSpecSnippet { 8 | 9 | void doSomething() { 10 | def one = String.class 11 | def two = String.class 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/basic/AssignmentInConditionalInspectionToolSpec/fixed.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | /** 4 | * Class to demonstrate code violations. Files before.txt and fixed.txt 5 | * are only generated when missing so you need to delete these files if you want to regenerated them. 6 | */ 7 | class AssignmentInConditionalInspectionToolSpecSnippet { 8 | 9 | void doSomething() { 10 | String a = 'hello' 11 | String b = 'world' 12 | 13 | while (a == 'hola') { 14 | a = 'hola' 15 | } 16 | 17 | while (b == 'svete') { 18 | b = 'svete' 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/testing/TestLibrary.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.testing; 2 | 3 | import com.intellij.openapi.module.Module; 4 | import com.intellij.openapi.roots.ModifiableRootModel; 5 | import com.intellij.openapi.roots.ModuleRootModificationUtil; 6 | import org.jspecify.annotations.NullMarked; 7 | 8 | @NullMarked 9 | public interface TestLibrary { 10 | default void addTo(Module module) { 11 | ModuleRootModificationUtil.updateModel(module, model -> addTo(module, model)); 12 | } 13 | 14 | void addTo(Module module, ModifiableRootModel model); 15 | 16 | default TestLibrary plus(TestLibrary library) { 17 | return new CompoundTestLibrary(this, library); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/groovyism/AssignCollectionUniqueInspectionToolSpec/before.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | /** 4 | * Class to demonstrate code violations. before.txt and fixed.txt 5 | * files are only generated when missing so you need to delete these files if you want to regenerated them. 6 | */ 7 | class AssignCollectionUniqueInspectionToolSpecSnippet { 8 | 9 | void doSomething() { 10 | List one = ['foo', 'bar'] 11 | List unique1 = one.unique() 12 | List unique2 = one.unique() 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/imports/NoWildcardImportsInspectionToolSpec/fixed.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | import com.example.One 4 | import com.example.Two 5 | import org.example.Four 6 | import org.example.Three 7 | 8 | /** 9 | * Class to demonstrate code violations. Files before.txt and fixed.txt 10 | * are only generated when missing so you need to delete these files if you want to regenerated them. 11 | */ 12 | class NoWildcardImportsInspectionToolSpecSnippet { 13 | 14 | void doSomething() { 15 | def one = new One() 16 | def two = new Two() 17 | def three = new Three() 18 | def four = new Four() 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/inspections/basic/AssignmentInConditionalInspectionToolSpec.groovy: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic 2 | 3 | import com.intellij.codeInspection.LocalInspectionTool 4 | import groovy.transform.CompileDynamic 5 | import org.codenarc.idea.testing.InspectionSpec 6 | 7 | @CompileDynamic 8 | class AssignmentInConditionalInspectionToolSpec extends InspectionSpec { 9 | 10 | @Override 11 | protected LocalInspectionTool createInspection() { 12 | return new AssignmentInConditionalInspectionTool() 13 | } 14 | 15 | @Override 16 | protected Iterable getClassesToInclude() { 17 | return Collections.singleton(JAVA_LANG_STRING) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/inspections/groovyism/AssignCollectionUniqueInspectionToolSpec.groovy: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.groovyism 2 | 3 | import com.intellij.codeInspection.LocalInspectionTool 4 | import groovy.transform.CompileStatic 5 | import org.codenarc.idea.testing.InspectionSpec 6 | 7 | @CompileStatic 8 | class AssignCollectionUniqueInspectionToolSpec extends InspectionSpec { 9 | 10 | @Override 11 | protected LocalInspectionTool createInspection() { 12 | return new AssignCollectionUniqueInspectionTool() 13 | } 14 | 15 | @Override 16 | protected Iterable getClassesToInclude() { 17 | return Collections.singleton(JAVA_UTIL_LIST) 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/inspections/convention/ImplicitReturnStatementInspectionToolSpec.groovy: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.convention 2 | 3 | import com.intellij.codeInspection.LocalInspectionTool 4 | import groovy.transform.CompileDynamic 5 | import org.codenarc.idea.testing.InspectionSpec 6 | 7 | @CompileDynamic 8 | class ImplicitReturnStatementInspectionToolSpec extends InspectionSpec { 9 | 10 | @Override 11 | protected LocalInspectionTool createInspection() { 12 | return new ImplicitReturnStatementInspectionTool() 13 | } 14 | 15 | @Override 16 | protected Iterable getClassesToInclude() { 17 | return Collections.singleton(JAVA_LANG_STRING) 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/inspections/unnecessary/UnnecessaryDotClassInspectionToolSpec.groovy: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.unnecessary 2 | 3 | import com.intellij.codeInspection.LocalInspectionTool 4 | import groovy.transform.CompileDynamic 5 | import org.codenarc.idea.testing.InspectionSpec 6 | 7 | @CompileDynamic 8 | class UnnecessaryDotClassInspectionToolSpec extends InspectionSpec { 9 | 10 | @Override 11 | protected LocalInspectionTool createInspection() { 12 | return new UnnecessaryDotClassInspectionTool() 13 | } 14 | 15 | @Override 16 | protected Iterable getClassesToInclude() { 17 | return [ 18 | JAVA_LANG_STRING 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/inspections/imports/NoWildcardImportsInspectionToolSpec.groovy: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.imports 2 | 3 | import com.intellij.codeInspection.LocalInspectionTool 4 | import groovy.transform.CompileDynamic 5 | import org.codenarc.idea.testing.InspectionSpec 6 | 7 | @CompileDynamic 8 | class NoWildcardImportsInspectionToolSpec extends InspectionSpec { 9 | 10 | @Override 11 | protected LocalInspectionTool createInspection() { 12 | return new NoWildcardImportsInspectionTool() 13 | } 14 | 15 | @Override 16 | protected Iterable getClassesToInclude() { 17 | return [COM_EXAMPLE_ONE, COM_EXAMPLE_TWO, ORG_EXAMPLE_THREE, ORG_EXAMPLE_FOUR] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/imports/UnusedImportInspectionToolSpec/before.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | import java.lang.String 4 | import java.util.List 5 | 6 | /** 7 | * Class to demonstrate code violations. Files before.txt and fixed.txt 8 | * are only generated when missing so you need to delete these files if you want to regenerated them. 9 | */ 10 | class UnusedImportInspectionToolSpecSnippet { 11 | 12 | void doSomething() { } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/imports/NoWildcardImportsInspectionToolSpec/before.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | import com.example.* 4 | import org.example.* 5 | 6 | /** 7 | * Class to demonstrate code violations. Files before.txt and fixed.txt 8 | * are only generated when missing so you need to delete these files if you want to regenerated them. 9 | */ 10 | class NoWildcardImportsInspectionToolSpecSnippet { 11 | 12 | void doSomething() { 13 | def one = new One() 14 | def two = new Two() 15 | def three = new Three() 16 | def four = new Four() 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/testing/CompoundTestLibrary.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.testing; 2 | 3 | import com.intellij.openapi.module.Module; 4 | import com.intellij.openapi.roots.ModifiableRootModel; 5 | import org.jspecify.annotations.NullMarked; 6 | 7 | @NullMarked 8 | public final class CompoundTestLibrary implements TestLibrary { 9 | private final TestLibrary[] myLibraries; 10 | 11 | public CompoundTestLibrary(TestLibrary... libraries) { 12 | assert libraries.length > 0; 13 | myLibraries = libraries; 14 | } 15 | 16 | @Override 17 | public void addTo(Module module, ModifiableRootModel model) { 18 | for (TestLibrary library : myLibraries) { 19 | library.addTo(module, model); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/convention/ImplicitReturnStatementInspectionToolSpec/before.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | /** 4 | * Class to demonstrate code violations. Files before.txt and fixed.txt 5 | * are only generated when missing so you need to delete these files if you want to regenerated them. 6 | */ 7 | class ImplicitReturnStatementInspectionToolSpecSnippet { 8 | 9 | String doSomething() { 10 | 'something' 11 | } 12 | 13 | String doStuff() { 14 | 'stuff' 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/groovyism/AssignCollectionSortInspectionToolSpec/before.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | /** 4 | * Class to demonstrate code violations. before.txt and fixed.txt 5 | * files are only generated when missing so you need to delete these files if you want to regenerated them. 6 | */ 7 | class AssignCollectionSortInspectionToolSpecSnippet { 8 | 9 | void doSomething() { 10 | List one = ['foo', 'bar'] 11 | List sorted1 = one.sort() 12 | List sorted2 = one.sort() 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/testing/LibraryLightProjectDescriptor.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.testing; 2 | 3 | import com.intellij.openapi.module.Module; 4 | import com.intellij.openapi.roots.ContentEntry; 5 | import com.intellij.openapi.roots.ModifiableRootModel; 6 | import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; 7 | import org.jspecify.annotations.NullMarked; 8 | 9 | @NullMarked 10 | public class LibraryLightProjectDescriptor extends DefaultLightProjectDescriptor { 11 | private final TestLibrary myLibrary; 12 | 13 | public LibraryLightProjectDescriptor(TestLibrary library) { 14 | myLibrary = library; 15 | } 16 | 17 | @Override 18 | public void configureModule( Module module, ModifiableRootModel model, ContentEntry contentEntry) { 19 | super.configureModule(module, model, contentEntry); 20 | myLibrary.addTo(module, model); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.github/workflows/gradle.yml: -------------------------------------------------------------------------------- 1 | name: Check 2 | 3 | on: [push, pull_request] 4 | jobs: 5 | check: 6 | name: Run Tests 7 | runs-on: ubuntu-latest 8 | if: github.event_name != 'push' || github.event.pull_request.head.repo.full_name == null 9 | env: 10 | GRADLE_OPTS: "-Xmx6g -Xms4g" 11 | CI: true 12 | steps: 13 | - name: Checkout source 14 | uses: actions/checkout@v6 15 | - name: Set up JDK 21 16 | uses: actions/setup-java@v5 17 | with: 18 | distribution: 'temurin' 19 | java-version: 21 20 | - name: Setup Gradle 21 | uses: gradle/actions/setup-gradle@v5 22 | - name: Run Tests 23 | run: ./gradlew test verifyPlugin --no-daemon --stacktrace 24 | - name: Show Reports 25 | uses: actions/upload-artifact@v4 26 | if: failure() 27 | with: 28 | name: reports 29 | path: build/reports/ 30 | -------------------------------------------------------------------------------- /src/test/resources/org/codenarc/idea/inspections/basic/AssignmentInConditionalInspectionToolSpec/before.txt: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | /** 4 | * Class to demonstrate code violations. Files before.txt and fixed.txt 5 | * are only generated when missing so you need to delete these files if you want to regenerated them. 6 | */ 7 | class AssignmentInConditionalInspectionToolSpecSnippet { 8 | 9 | void doSomething() { 10 | String a = 'hello' 11 | String b = 'world' 12 | 13 | while (a = 'hola') { 14 | a = 'hola' 15 | } 16 | 17 | while (b = 'svete') { 18 | b = 'svete' 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/Utils.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea; 2 | 3 | import org.jspecify.annotations.NullMarked; 4 | 5 | @NullMarked 6 | final class Utils { 7 | static String camelCaseToSentence(String camelCased) { 8 | if (camelCased.isBlank()) { 9 | return camelCased; 10 | } 11 | 12 | var buf = new StringBuilder(camelCased); 13 | buf.setCharAt(0, Character.toUpperCase(buf.charAt(0))); 14 | for (int i = 1; i < buf.length() - 1; i++) { 15 | if ( 16 | Character.isLowerCase(buf.charAt(i - 1)) && 17 | Character.isUpperCase(buf.charAt(i)) && 18 | Character.isLowerCase(buf.charAt(i + 1)) 19 | ) { 20 | buf.insert(i++, " "); 21 | buf.setCharAt(i, Character.toLowerCase(buf.charAt(i))); 22 | } 23 | } 24 | 25 | return buf.toString(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/quickfix/ReusableIntention.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.quickfix; 2 | 3 | import com.intellij.codeInsight.intention.IntentionAction; 4 | import com.intellij.openapi.editor.Editor; 5 | import com.intellij.openapi.project.Project; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.util.IncorrectOperationException; 8 | import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate; 9 | import org.jspecify.annotations.NullMarked; 10 | import org.jspecify.annotations.Nullable; 11 | 12 | /** 13 | * Exposes internal protected methods of {@link org.jetbrains.plugins.groovy.intentions.base.Intention} to allow using 14 | * it as quick fix. 15 | */ 16 | @NullMarked 17 | public interface ReusableIntention extends IntentionAction { 18 | Class getDelegateClass(); 19 | 20 | void processIntention( 21 | PsiElement element, 22 | Project project, 23 | @Nullable Editor editor 24 | ) throws IncorrectOperationException; 25 | 26 | PsiElementPredicate getElementPredicate(); 27 | } -------------------------------------------------------------------------------- /src/test/groovy/org/codenarc/idea/inspections/imports/UnusedImportInspectionToolSpec.groovy: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.imports 2 | 3 | import com.intellij.codeInsight.intention.IntentionAction 4 | import com.intellij.codeInspection.LocalInspectionTool 5 | import groovy.transform.CompileDynamic 6 | import org.codenarc.idea.testing.InspectionSpec 7 | import org.jetbrains.plugins.groovy.codeInspection.GroovyOptimizeImportsFix 8 | 9 | @CompileDynamic 10 | class UnusedImportInspectionToolSpec extends InspectionSpec { 11 | 12 | @Override 13 | protected LocalInspectionTool createInspection() { 14 | return new UnusedImportInspectionTool() 15 | } 16 | 17 | @Override 18 | protected Iterable getClassesToInclude() { 19 | return [JAVA_LANG_STRING, JAVA_UTIL_LIST] 20 | } 21 | 22 | @Override 23 | @SuppressWarnings(['ImplicitClosureParameter', 'Instanceof']) 24 | protected List getRelevantFixes() { 25 | return super.relevantFixes.findAll { !(it instanceof GroovyOptimizeImportsFix) } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /.run/codenarc-idea [runIde].run.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 16 | 18 | true 19 | true 20 | false 21 | false 22 | 23 | 24 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release to Stable Channel 2 | # https://plugins.jetbrains.com/plugin/5925-codenarc/versions/stable 3 | 4 | on: 5 | release: 6 | types: [published] 7 | workflow_dispatch: 8 | inputs: 9 | version: 10 | description: "Plugin version" 11 | required: true 12 | type: string 13 | 14 | jobs: 15 | release: 16 | name: Stable Release 17 | runs-on: ubuntu-latest 18 | env: 19 | GRADLE_OPTS: "-Xmx6g -Xms4g" 20 | CI: true 21 | JETBRAINS_MARKETPLACE_TOKEN: ${{ secrets.JB_PLUGINS_TOKEN }} 22 | steps: 23 | - name: Checkout source 24 | uses: actions/checkout@v6 25 | - name: Set up Java 26 | uses: actions/setup-java@v5 27 | with: 28 | distribution: 'temurin' 29 | java-version: 21 30 | - name: Setup Gradle 31 | uses: gradle/actions/setup-gradle@v5 32 | - name: Build and publish to JetBrains Marketplace Stable channel with Gradle 33 | run: ./gradlew publishPlugin --no-daemon -PpublishPluginChannels=stable -PpluginVersion="${{ github.event.inputs.version || github.ref_name }}" 34 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/CodeNarcBundle.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea; 2 | 3 | import com.intellij.DynamicBundle; 4 | import org.jetbrains.annotations.Nls; 5 | import org.jetbrains.annotations.NonNls; 6 | import org.jetbrains.annotations.PropertyKey; 7 | import org.jspecify.annotations.NullMarked; 8 | import org.jspecify.annotations.Nullable; 9 | 10 | import java.util.function.Supplier; 11 | 12 | @NullMarked 13 | public class CodeNarcBundle extends DynamicBundle { 14 | @NonNls 15 | private static final String BUNDLE = "messages.CodeNarcBundle"; 16 | private static final CodeNarcBundle INSTANCE = new CodeNarcBundle(); 17 | 18 | private CodeNarcBundle() { 19 | super(BUNDLE); 20 | } 21 | 22 | public static @Nls String message(@PropertyKey(resourceBundle = BUNDLE) String key, @Nullable Object... params) { 23 | return INSTANCE.getMessage(key, params); 24 | } 25 | 26 | public static Supplier messagePointer( 27 | @PropertyKey(resourceBundle = BUNDLE) String key, 28 | @Nullable Object... params 29 | ) { 30 | return INSTANCE.getLazyMessage(key, params); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/quickfix/DeleteElementQuickFix.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.quickfix; 2 | 3 | import com.intellij.codeInsight.daemon.impl.quickfix.DeleteElementFix; 4 | import com.intellij.codeInspection.ProblemDescriptor; 5 | import com.intellij.codeInspection.util.IntentionFamilyName; 6 | import com.intellij.openapi.project.Project; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.util.IncorrectOperationException; 9 | import com.siyeh.ig.psiutils.CommentTracker; 10 | import org.jetbrains.plugins.groovy.codeInspection.GroovyFix; 11 | import org.jspecify.annotations.NullMarked; 12 | 13 | @NullMarked 14 | public class DeleteElementQuickFix extends GroovyFix { 15 | private final DeleteElementFix delegate; 16 | private final PsiElement element; 17 | 18 | public DeleteElementQuickFix(PsiElement element) { 19 | this.element = element; 20 | delegate = new DeleteElementFix(element); 21 | } 22 | 23 | @Override 24 | protected void doFix(Project project, ProblemDescriptor problemDescriptor) throws IncorrectOperationException { 25 | new CommentTracker().deleteAndRestoreComments(element); 26 | } 27 | 28 | @Override 29 | public @IntentionFamilyName String getFamilyName() { 30 | return delegate.getFamilyName(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.github/workflows/beta_release.yml: -------------------------------------------------------------------------------- 1 | name: Release to Beta Channel 2 | # https://plugins.jetbrains.com/plugin/5925-codenarc/versions/beta 3 | 4 | on: 5 | push: 6 | branches: 7 | - master 8 | 9 | jobs: 10 | release: 11 | name: Beta Release 12 | runs-on: ubuntu-latest 13 | env: 14 | GRADLE_OPTS: "-Xmx6g -Xms4g" 15 | CI: true 16 | JETBRAINS_MARKETPLACE_TOKEN: ${{ secrets.JB_PLUGINS_TOKEN }} 17 | steps: 18 | - name: Checkout source 19 | uses: actions/checkout@v6 20 | - name: Set up Java 21 | uses: actions/setup-java@v5 22 | with: 23 | distribution: 'temurin' 24 | java-version: 21 25 | - name: Setup Gradle 26 | uses: gradle/actions/setup-gradle@v5 27 | - name: Set dynamic Beta version 28 | id: version_step 29 | run: | 30 | # Expected result example: BETA_VERSION=7.0.1-20220126120000 31 | PLUGIN_VERSION=$(grep 'pluginVersion' gradle.properties | awk -F'=' '{print $2}' | tr -d '[:space:]') 32 | BETA_SUFFIX=$(date +%Y%m%d%H%M%S) 33 | echo "BETA_VERSION=${PLUGIN_VERSION}-${BETA_SUFFIX}" >> $GITHUB_ENV 34 | - name: Build and publish to JetBrains Marketplace Beta channel with Gradle 35 | run: ./gradlew publishPlugin --no-daemon -PpublishPluginChannels=beta -PpluginVersion=${{ env.BETA_VERSION }} 36 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/imports/DuplicateImportInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.imports; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.imports.DuplicateImportRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class DuplicateImportInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.imports.DuplicateImportRule 17 | 18 | public static final String GROUP = "Imports"; 19 | 20 | public DuplicateImportInspectionTool() { 21 | super(new DuplicateImportRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/formatting/TrailingWhitespaceInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.formatting; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.formatting.TrailingWhitespaceRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class TrailingWhitespaceInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.formatting.TrailingWhitespaceRule 17 | 18 | public static final String GROUP = "Formatting"; 19 | 20 | public TrailingWhitespaceInspectionTool() { 21 | super(new TrailingWhitespaceRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/imports/ImportFromSamePackageInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.imports; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.imports.ImportFromSamePackageRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ImportFromSamePackageInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.imports.ImportFromSamePackageRule 17 | 18 | public static final String GROUP = "Imports"; 19 | 20 | public ImportFromSamePackageInspectionTool() { 21 | super(new ImportFromSamePackageRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/comments/JavadocEmptyFirstLineInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.comments; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.comments.JavadocEmptyFirstLineRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class JavadocEmptyFirstLineInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.comments.JavadocEmptyFirstLineRule 17 | 18 | public static final String GROUP = "Comments"; 19 | 20 | public JavadocEmptyFirstLineInspectionTool() { 21 | super(new JavadocEmptyFirstLineRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/naming/ClassNameSameAsFilenameInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.naming; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.naming.ClassNameSameAsFilenameRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ClassNameSameAsFilenameInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.naming.ClassNameSameAsFilenameRule 17 | 18 | public static final String GROUP = "Naming"; 19 | 20 | public ClassNameSameAsFilenameInspectionTool() { 21 | super(new ClassNameSameAsFilenameRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/formatting/ConsecutiveBlankLinesInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.formatting; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.formatting.ConsecutiveBlankLinesRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ConsecutiveBlankLinesInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.formatting.ConsecutiveBlankLinesRule 17 | 18 | public static final String GROUP = "Formatting"; 19 | 20 | public ConsecutiveBlankLinesInspectionTool() { 21 | super(new ConsecutiveBlankLinesRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/imports/UnnecessaryGroovyImportInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.imports; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.imports.UnnecessaryGroovyImportRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class UnnecessaryGroovyImportInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.imports.UnnecessaryGroovyImportRule 17 | 18 | public static final String GROUP = "Imports"; 19 | 20 | public UnnecessaryGroovyImportInspectionTool() { 21 | super(new UnnecessaryGroovyImportRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/formatting/BlankLineBeforePackageInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.formatting; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.formatting.BlankLineBeforePackageRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class BlankLineBeforePackageInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.formatting.BlankLineBeforePackageRule 17 | 18 | public static final String GROUP = "Formatting"; 19 | 20 | public BlankLineBeforePackageInspectionTool() { 21 | super(new BlankLineBeforePackageRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/formatting/FileEndsWithoutNewlineInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.formatting; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.formatting.FileEndsWithoutNewlineRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class FileEndsWithoutNewlineInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.formatting.FileEndsWithoutNewlineRule 17 | 18 | public static final String GROUP = "Formatting"; 19 | 20 | public FileEndsWithoutNewlineInspectionTool() { 21 | super(new FileEndsWithoutNewlineRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/comments/SpaceAfterCommentDelimiterInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.comments; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.comments.SpaceAfterCommentDelimiterRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class SpaceAfterCommentDelimiterInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.comments.SpaceAfterCommentDelimiterRule 17 | 18 | public static final String GROUP = "Comments"; 19 | 20 | public SpaceAfterCommentDelimiterInspectionTool() { 21 | super(new SpaceAfterCommentDelimiterRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/comments/SpaceBeforeCommentDelimiterInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.comments; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.comments.SpaceBeforeCommentDelimiterRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class SpaceBeforeCommentDelimiterInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.comments.SpaceBeforeCommentDelimiterRule 17 | 18 | public static final String GROUP = "Comments"; 19 | 20 | public SpaceBeforeCommentDelimiterInspectionTool() { 21 | super(new SpaceBeforeCommentDelimiterRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/formatting/MissingBlankLineAfterImportsInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.formatting; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.formatting.MissingBlankLineAfterImportsRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class MissingBlankLineAfterImportsInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.formatting.MissingBlankLineAfterImportsRule 17 | 18 | public static final String GROUP = "Formatting"; 19 | 20 | public MissingBlankLineAfterImportsInspectionTool() { 21 | super(new MissingBlankLineAfterImportsRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/formatting/MissingBlankLineAfterPackageInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.formatting; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.formatting.MissingBlankLineAfterPackageRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class MissingBlankLineAfterPackageInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.formatting.MissingBlankLineAfterPackageRule 17 | 18 | public static final String GROUP = "Formatting"; 19 | 20 | public MissingBlankLineAfterPackageInspectionTool() { 21 | super(new MissingBlankLineAfterPackageRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | // custom code can be written after this line and it will be preserved during the regeneration 31 | 32 | @Override 33 | protected @NonNull Collection getQuickFixesFor( 34 | @NonNull Violation violation, 35 | @NonNull PsiElement violatingElement 36 | ) { 37 | return Collections.emptyList(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/quickfix/ConvertGStringToStringReusableIntention.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.quickfix; 2 | 3 | import com.intellij.openapi.editor.Editor; 4 | import com.intellij.openapi.project.Project; 5 | import com.intellij.psi.PsiElement; 6 | import com.intellij.util.IncorrectOperationException; 7 | import org.jetbrains.plugins.groovy.intentions.base.Intention; 8 | import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate; 9 | import org.jetbrains.plugins.groovy.intentions.conversions.strings.ConvertGStringToStringIntention; 10 | import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral; 11 | import org.jetbrains.plugins.groovy.lang.psi.impl.PsiImplUtil; 12 | import org.jspecify.annotations.NullMarked; 13 | import org.jspecify.annotations.Nullable; 14 | 15 | @NullMarked 16 | public class ConvertGStringToStringReusableIntention extends Intention implements ReusableIntention { 17 | private final ConvertGStringToStringIntention delegate = new ConvertGStringToStringIntention(); 18 | 19 | @Override 20 | public Class getDelegateClass() { 21 | return delegate.getClass(); 22 | } 23 | 24 | @Override 25 | public void processIntention( 26 | PsiElement element, 27 | Project project, 28 | @Nullable Editor editor 29 | ) throws IncorrectOperationException { 30 | final GrLiteral exp = (GrLiteral) element; 31 | PsiImplUtil.replaceExpression(ConvertGStringToStringIntention.convertGStringLiteralToStringLiteral(exp), exp); 32 | } 33 | 34 | @Override 35 | public PsiElementPredicate getElementPredicate() { 36 | return delegate.getElementPredicate(); 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/generic/IllegalRegexInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.generic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.generic.IllegalRegexRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class IllegalRegexInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.generic.IllegalRegexRule 17 | 18 | public static final String GROUP = "Generic"; 19 | 20 | public IllegalRegexInspectionTool() { 21 | super(new IllegalRegexRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setRegex(String value) { 32 | getRule().setRegex(value); 33 | } 34 | 35 | public String getRegex() { 36 | return getRule().getRegex(); 37 | } 38 | 39 | // custom code can be written after this line and it will be preserved during the regeneration 40 | 41 | @Override 42 | protected @NonNull Collection getQuickFixesFor( 43 | @NonNull Violation violation, 44 | @NonNull PsiElement violatingElement 45 | ) { 46 | return Collections.emptyList(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/generic/RequiredRegexInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.generic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.generic.RequiredRegexRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class RequiredRegexInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.generic.RequiredRegexRule 17 | 18 | public static final String GROUP = "Generic"; 19 | 20 | public RequiredRegexInspectionTool() { 21 | super(new RequiredRegexRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setRegex(String value) { 32 | getRule().setRegex(value); 33 | } 34 | 35 | public String getRegex() { 36 | return getRule().getRegex(); 37 | } 38 | 39 | // custom code can be written after this line and it will be preserved during the regeneration 40 | 41 | @Override 42 | protected @NonNull Collection getQuickFixesFor( 43 | @NonNull Violation violation, 44 | @NonNull PsiElement violatingElement 45 | ) { 46 | return Collections.emptyList(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/imports/UnusedImportInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.imports; 2 | 3 | import com.intellij.codeInspection.CleanupLocalInspectionTool; 4 | import com.intellij.codeInspection.LocalQuickFix; 5 | import com.intellij.psi.PsiElement; 6 | import java.util.Collection; 7 | import java.util.Collections; 8 | import javax.annotation.Generated; 9 | import org.codenarc.idea.CodeNarcInspectionTool; 10 | import org.codenarc.idea.quickfix.DeleteElementQuickFix; 11 | import org.codenarc.rule.Violation; 12 | import org.codenarc.rule.imports.UnusedImportRule; 13 | import org.jspecify.annotations.NonNull; 14 | 15 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 16 | public class UnusedImportInspectionTool extends CodeNarcInspectionTool implements CleanupLocalInspectionTool { 17 | 18 | // this code has been generated from org.codenarc.rule.imports.UnusedImportRule 19 | 20 | public static final String GROUP = "Imports"; 21 | 22 | public UnusedImportInspectionTool() { 23 | super(new UnusedImportRule()); 24 | applyDefaultConfiguration(getRule()); 25 | } 26 | 27 | @Override 28 | public String getRuleset() { 29 | return GROUP; 30 | } 31 | 32 | // custom code can be written after this line and it will be preserved during the regeneration 33 | 34 | @Override 35 | protected @NonNull Collection getQuickFixesFor( 36 | @NonNull Violation violation, 37 | @NonNull PsiElement violatingElement 38 | ) { 39 | return Collections.singleton(new DeleteElementQuickFix(violatingElement)); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/generic/IllegalStringInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.generic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.generic.IllegalStringRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class IllegalStringInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.generic.IllegalStringRule 17 | 18 | public static final String GROUP = "Generic"; 19 | 20 | public IllegalStringInspectionTool() { 21 | super(new IllegalStringRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setString(String value) { 32 | getRule().setString(value); 33 | } 34 | 35 | public String getString() { 36 | return getRule().getString(); 37 | } 38 | 39 | // custom code can be written after this line and it will be preserved during the regeneration 40 | 41 | @Override 42 | protected @NonNull Collection getQuickFixesFor( 43 | @NonNull Violation violation, 44 | @NonNull PsiElement violatingElement 45 | ) { 46 | return Collections.emptyList(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/generic/RequiredStringInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.generic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.generic.RequiredStringRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class RequiredStringInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.generic.RequiredStringRule 17 | 18 | public static final String GROUP = "Generic"; 19 | 20 | public RequiredStringInspectionTool() { 21 | super(new RequiredStringRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setString(String value) { 32 | getRule().setString(value); 33 | } 34 | 35 | public String getString() { 36 | return getRule().getString(); 37 | } 38 | 39 | // custom code can be written after this line and it will be preserved during the regeneration 40 | 41 | @Override 42 | protected @NonNull Collection getQuickFixesFor( 43 | @NonNull Violation violation, 44 | @NonNull PsiElement violatingElement 45 | ) { 46 | return Collections.emptyList(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/formatting/BracesForClassInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.formatting; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.formatting.BracesForClassRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class BracesForClassInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.formatting.BracesForClassRule 17 | 18 | public static final String GROUP = "Formatting"; 19 | 20 | public BracesForClassInspectionTool() { 21 | super(new BracesForClassRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setSameLine(boolean value) { 32 | getRule().setSameLine(value); 33 | } 34 | 35 | public boolean isSameLine() { 36 | return getRule().isSameLine(); 37 | } 38 | 39 | // custom code can be written after this line and it will be preserved during the regeneration 40 | 41 | @Override 42 | protected @NonNull Collection getQuickFixesFor( 43 | @NonNull Violation violation, 44 | @NonNull PsiElement violatingElement 45 | ) { 46 | return Collections.emptyList(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/convention/NoTabCharacterInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.convention; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.convention.NoTabCharacterRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class NoTabCharacterInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.convention.NoTabCharacterRule 17 | 18 | public static final String GROUP = "Convention"; 19 | 20 | public NoTabCharacterInspectionTool() { 21 | super(new NoTabCharacterRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setTabCharacter(String value) { 32 | getRule().setTabCharacter(value); 33 | } 34 | 35 | public String getTabCharacter() { 36 | return getRule().getTabCharacter(); 37 | } 38 | 39 | // custom code can be written after this line and it will be preserved during the regeneration 40 | 41 | @Override 42 | protected @NonNull Collection getQuickFixesFor( 43 | @NonNull Violation violation, 44 | @NonNull PsiElement violatingElement 45 | ) { 46 | return Collections.emptyList(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/comments/ClassJavadocInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.comments; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.comments.ClassJavadocRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ClassJavadocInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.comments.ClassJavadocRule 17 | 18 | public static final String GROUP = "Comments"; 19 | 20 | public ClassJavadocInspectionTool() { 21 | super(new ClassJavadocRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToNonMainClasses(boolean value) { 32 | getRule().setApplyToNonMainClasses(value); 33 | } 34 | 35 | public boolean isApplyToNonMainClasses() { 36 | return getRule().isApplyToNonMainClasses(); 37 | } 38 | 39 | // custom code can be written after this line and it will be preserved during the regeneration 40 | 41 | @Override 42 | protected @NonNull Collection getQuickFixesFor( 43 | @NonNull Violation violation, 44 | @NonNull PsiElement violatingElement 45 | ) { 46 | return Collections.emptyList(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/imports/MisorderedStaticImportsInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.imports; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.imports.MisorderedStaticImportsRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class MisorderedStaticImportsInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.imports.MisorderedStaticImportsRule 17 | 18 | public static final String GROUP = "Imports"; 19 | 20 | public MisorderedStaticImportsInspectionTool() { 21 | super(new MisorderedStaticImportsRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setComesBefore(boolean value) { 32 | getRule().setComesBefore(value); 33 | } 34 | 35 | public boolean isComesBefore() { 36 | return getRule().isComesBefore(); 37 | } 38 | 39 | // custom code can be written after this line and it will be preserved during the regeneration 40 | 41 | @Override 42 | protected @NonNull Collection getQuickFixesFor( 43 | @NonNull Violation violation, 44 | @NonNull PsiElement violatingElement 45 | ) { 46 | return Collections.emptyList(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/naming/PackageNameMatchesFilePathInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.naming; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.naming.PackageNameMatchesFilePathRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class PackageNameMatchesFilePathInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.naming.PackageNameMatchesFilePathRule 17 | 18 | public static final String GROUP = "Naming"; 19 | 20 | public PackageNameMatchesFilePathInspectionTool() { 21 | super(new PackageNameMatchesFilePathRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setGroupId(String value) { 32 | getRule().setGroupId(value); 33 | } 34 | 35 | public String getGroupId() { 36 | return getRule().getGroupId(); 37 | } 38 | 39 | // custom code can be written after this line and it will be preserved during the regeneration 40 | 41 | @Override 42 | protected @NonNull Collection getQuickFixesFor( 43 | @NonNull Violation violation, 44 | @NonNull PsiElement violatingElement 45 | ) { 46 | return Collections.emptyList(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/quickfix/ReplacePrintlnWithAnnotationFix.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.quickfix; 2 | 3 | import com.intellij.codeInspection.ProblemDescriptor; 4 | import com.intellij.openapi.project.Project; 5 | import com.intellij.psi.PsiAnnotation; 6 | import com.intellij.psi.PsiClass; 7 | import com.intellij.psi.codeStyle.JavaCodeStyleManager; 8 | import com.intellij.psi.util.PsiUtil; 9 | import com.intellij.util.IncorrectOperationException; 10 | import groovy.util.logging.Slf4j; 11 | import org.codenarc.idea.CodeNarcBundle; 12 | import org.jetbrains.plugins.groovy.codeInspection.GroovyFix; 13 | import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrMethodCall; 14 | import org.jspecify.annotations.NullMarked; 15 | 16 | @NullMarked 17 | public class ReplacePrintlnWithAnnotationFix extends GroovyFix { 18 | @Override 19 | protected void doFix(Project project, ProblemDescriptor descriptor) throws IncorrectOperationException { 20 | PsiClass topLevelClass = PsiUtil.getTopLevelClass(descriptor.getPsiElement()); 21 | 22 | if (topLevelClass == null) { 23 | return; 24 | } 25 | 26 | var annotationFqn = Slf4j.class.getName(); 27 | var modifierList = topLevelClass.getModifierList(); 28 | if (modifierList != null && modifierList.findAnnotation(annotationFqn) == null) { 29 | PsiAnnotation annotation = modifierList.addAnnotation(annotationFqn); 30 | JavaCodeStyleManager.getInstance(project).shortenClassReferences(annotation); 31 | } 32 | 33 | new ReplaceStatementFix(GrMethodCall.class, "println", "log.info").applyFix(project, descriptor); 34 | } 35 | 36 | @Override 37 | public String getFamilyName() { 38 | return CodeNarcBundle.message("use.logging.instead.of.println"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/quickfix/AddExplicitReturnQuickFix.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.quickfix; 2 | 3 | import com.intellij.codeInspection.ProblemDescriptor; 4 | import com.intellij.codeInspection.util.IntentionFamilyName; 5 | import com.intellij.openapi.project.Project; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.util.IncorrectOperationException; 8 | import org.codenarc.idea.CodeNarcBundle; 9 | import org.jetbrains.plugins.groovy.codeInspection.GroovyFix; 10 | import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement; 11 | import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrCodeBlock; 12 | import org.jspecify.annotations.NullMarked; 13 | 14 | import java.util.Arrays; 15 | 16 | @NullMarked 17 | public class AddExplicitReturnQuickFix extends GroovyFix { 18 | @Override 19 | protected void doFix(Project project, ProblemDescriptor problemDescriptor) throws IncorrectOperationException { 20 | PsiElement psiElement = problemDescriptor.getPsiElement(); 21 | 22 | GrCodeBlock body = Arrays.stream(psiElement.getChildren()) 23 | .filter(e -> e instanceof GrCodeBlock) 24 | .findFirst() 25 | .map(GrCodeBlock.class::cast) 26 | .orElse(null); 27 | 28 | if (body == null) { 29 | return; 30 | } 31 | 32 | GrStatement[] statements = body.getStatements(); 33 | 34 | if (statements.length == 0) { 35 | return; 36 | } 37 | 38 | GrStatement lastStatement = statements[statements.length - 1]; 39 | 40 | replaceStatement(lastStatement, "return " + lastStatement.getText()); 41 | 42 | System.out.println(lastStatement); 43 | } 44 | 45 | @Override 46 | public @IntentionFamilyName String getFamilyName() { 47 | return CodeNarcBundle.message("add.explicit.return"); 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/quickfix/ReplaceStatementFix.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.quickfix; 2 | 3 | import com.intellij.codeInspection.ProblemDescriptor; 4 | import com.intellij.openapi.project.Project; 5 | import com.intellij.psi.PsiElement; 6 | import com.intellij.util.IncorrectOperationException; 7 | import org.codenarc.idea.CodeNarcBundle; 8 | import org.jetbrains.plugins.groovy.codeInspection.GroovyFix; 9 | import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement; 10 | import org.jspecify.annotations.NullMarked; 11 | 12 | @NullMarked 13 | public class ReplaceStatementFix extends GroovyFix { 14 | private final Class target; 15 | private final String original; 16 | private final String replacement; 17 | 18 | public ReplaceStatementFix(Class target, String original, String replacement) { 19 | this.target = target; 20 | this.original = original; 21 | this.replacement = replacement; 22 | } 23 | 24 | @Override 25 | public String getFamilyName() { 26 | return CodeNarcBundle.message("replace.text", original, replacement); 27 | } 28 | 29 | @Override 30 | protected void doFix(Project project, ProblemDescriptor descriptor) throws IncorrectOperationException { 31 | replaceCode(descriptor.getPsiElement()); 32 | } 33 | 34 | private boolean replaceCode(PsiElement element) { 35 | if (target.isInstance(element)) { 36 | replaceCode((GrStatement) element, element.getText()); 37 | return true; 38 | } 39 | 40 | for (PsiElement child : element.getChildren()) { 41 | if (replaceCode(child)) { 42 | return true; 43 | } 44 | } 45 | 46 | return false; 47 | } 48 | 49 | private void replaceCode(GrStatement statement, String text) { 50 | replaceStatement(statement, text.replace(original, replacement)); 51 | } 52 | } -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/DeadCodeInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.DeadCodeRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class DeadCodeInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.DeadCodeRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public DeadCodeInspectionTool() { 21 | super(new DeadCodeRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/convention/NoDefInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.convention; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.convention.NoDefRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class NoDefInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.convention.NoDefRule 17 | 18 | public static final String GROUP = "Convention"; 19 | 20 | public NoDefInspectionTool() { 21 | super(new NoDefRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/EmptyClassInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.EmptyClassRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class EmptyClassInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.EmptyClassRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public EmptyClassInspectionTool() { 21 | super(new EmptyClassRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/convention/NoFloatInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.convention; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.convention.NoFloatRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class NoFloatInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.convention.NoFloatRule 17 | 18 | public static final String GROUP = "Convention"; 19 | 20 | public NoFloatInspectionTool() { 21 | super(new NoFloatRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/EmptyMethodInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.EmptyMethodRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class EmptyMethodInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.EmptyMethodRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public EmptyMethodInspectionTool() { 21 | super(new EmptyMethodRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/junit/ChainedTestInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.junit; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.junit.ChainedTestRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ChainedTestInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.junit.ChainedTestRule 17 | 18 | public static final String GROUP = "Junit"; 19 | 20 | public ChainedTestInspectionTool() { 21 | super(new ChainedTestRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/ClassForNameInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.ClassForNameRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ClassForNameInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.ClassForNameRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public ClassForNameInspectionTool() { 21 | super(new ClassForNameRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/convention/NoDoubleInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.convention; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.convention.NoDoubleRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class NoDoubleInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.convention.NoDoubleRule 17 | 18 | public static final String GROUP = "Convention"; 19 | 20 | public NoDoubleInspectionTool() { 21 | super(new NoDoubleRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/unused/UnusedArrayInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.unused; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.unused.UnusedArrayRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class UnusedArrayInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.unused.UnusedArrayRule 17 | 18 | public static final String GROUP = "Unused"; 19 | 20 | public UnusedArrayInspectionTool() { 21 | super(new UnusedArrayRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/concurrency/BusyWaitInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.concurrency; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.concurrency.BusyWaitRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class BusyWaitInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.concurrency.BusyWaitRule 17 | 18 | public static final String GROUP = "Concurrency"; 19 | 20 | public BusyWaitInspectionTool() { 21 | super(new BusyWaitRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/security/SystemExitInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.security; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.security.SystemExitRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class SystemExitInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.security.SystemExitRule 17 | 18 | public static final String GROUP = "Security"; 19 | 20 | public SystemExitInspectionTool() { 21 | super(new SystemExitRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/unused/UnusedObjectInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.unused; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.unused.UnusedObjectRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class UnusedObjectInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.unused.UnusedObjectRule 17 | 18 | public static final String GROUP = "Unused"; 19 | 20 | public UnusedObjectInspectionTool() { 21 | super(new UnusedObjectRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/EmptyTryBlockInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.EmptyTryBlockRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class EmptyTryBlockInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.EmptyTryBlockRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public EmptyTryBlockInspectionTool() { 21 | super(new EmptyTryBlockRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/junit/JUnitLostTestInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.junit; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.junit.JUnitLostTestRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class JUnitLostTestInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.junit.JUnitLostTestRule 17 | 18 | public static final String GROUP = "Junit"; 19 | 20 | public JUnitLostTestInspectionTool() { 21 | super(new JUnitLostTestRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/DoubleNegativeInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.DoubleNegativeRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class DoubleNegativeInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.DoubleNegativeRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public DoubleNegativeInspectionTool() { 21 | super(new DoubleNegativeRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/EmptyElseBlockInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.EmptyElseBlockRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class EmptyElseBlockInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.EmptyElseBlockRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public EmptyElseBlockInspectionTool() { 21 | super(new EmptyElseBlockRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/design/NestedForLoopInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.design; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.design.NestedForLoopRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class NestedForLoopInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.design.NestedForLoopRule 17 | 18 | public static final String GROUP = "Design"; 19 | 20 | public NestedForLoopInspectionTool() { 21 | super(new NestedForLoopRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/design/OptionalFieldInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.design; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.design.OptionalFieldRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class OptionalFieldInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.design.OptionalFieldRule 17 | 18 | public static final String GROUP = "Design"; 19 | 20 | public OptionalFieldInspectionTool() { 21 | super(new OptionalFieldRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/exceptions/CatchErrorInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.exceptions; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.exceptions.CatchErrorRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class CatchErrorInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.exceptions.CatchErrorRule 17 | 18 | public static final String GROUP = "Exceptions"; 19 | 20 | public CatchErrorInspectionTool() { 21 | super(new CatchErrorRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/exceptions/ThrowErrorInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.exceptions; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.exceptions.ThrowErrorRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ThrowErrorInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.exceptions.ThrowErrorRule 17 | 18 | public static final String GROUP = "Exceptions"; 19 | 20 | public ThrowErrorInspectionTool() { 21 | super(new ThrowErrorRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/BrokenNullCheckInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.BrokenNullCheckRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class BrokenNullCheckInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.BrokenNullCheckRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public BrokenNullCheckInspectionTool() { 21 | super(new BrokenNullCheckRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/DuplicateMapKeyInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.DuplicateMapKeyRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class DuplicateMapKeyInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.DuplicateMapKeyRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public DuplicateMapKeyInspectionTool() { 21 | super(new DuplicateMapKeyRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/RemoveAllOnSelfInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.RemoveAllOnSelfRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class RemoveAllOnSelfInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.RemoveAllOnSelfRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public RemoveAllOnSelfInspectionTool() { 21 | super(new RemoveAllOnSelfRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/concurrency/ThreadGroupInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.concurrency; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.concurrency.ThreadGroupRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ThreadGroupInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.concurrency.ThreadGroupRule 17 | 18 | public static final String GROUP = "Concurrency"; 19 | 20 | public ThreadGroupInspectionTool() { 21 | super(new ThreadGroupRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/concurrency/ThreadYieldInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.concurrency; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.concurrency.ThreadYieldRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ThreadYieldInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.concurrency.ThreadYieldRule 17 | 18 | public static final String GROUP = "Concurrency"; 19 | 20 | public ThreadYieldInspectionTool() { 21 | super(new ThreadYieldRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/convention/CouldBeElvisInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.convention; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.convention.CouldBeElvisRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class CouldBeElvisInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.convention.CouldBeElvisRule 17 | 18 | public static final String GROUP = "Convention"; 19 | 20 | public CouldBeElvisInspectionTool() { 21 | super(new CouldBeElvisRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/formatting/SpaceAfterIfInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.formatting; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.formatting.SpaceAfterIfRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class SpaceAfterIfInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.formatting.SpaceAfterIfRule 17 | 18 | public static final String GROUP = "Formatting"; 19 | 20 | public SpaceAfterIfInspectionTool() { 21 | super(new SpaceAfterIfRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/junit/CoupledTestCaseInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.junit; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.junit.CoupledTestCaseRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class CoupledTestCaseInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.junit.CoupledTestCaseRule 17 | 18 | public static final String GROUP = "Junit"; 19 | 20 | public CoupledTestCaseInspectionTool() { 21 | super(new CoupledTestCaseRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/junit/UnnecessaryFailInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.junit; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.junit.UnnecessaryFailRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class UnnecessaryFailInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.junit.UnnecessaryFailRule 17 | 18 | public static final String GROUP = "Junit"; 19 | 20 | public UnnecessaryFailInspectionTool() { 21 | super(new UnnecessaryFailRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/logging/SystemErrPrintInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.logging; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.logging.SystemErrPrintRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class SystemErrPrintInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.logging.SystemErrPrintRule 17 | 18 | public static final String GROUP = "Logging"; 19 | 20 | public SystemErrPrintInspectionTool() { 21 | super(new SystemErrPrintRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/logging/SystemOutPrintInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.logging; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.logging.SystemOutPrintRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class SystemOutPrintInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.logging.SystemOutPrintRule 17 | 18 | public static final String GROUP = "Logging"; 19 | 20 | public SystemOutPrintInspectionTool() { 21 | super(new SystemOutPrintRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/EmptyIfStatementInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.EmptyIfStatementRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class EmptyIfStatementInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.EmptyIfStatementRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public EmptyIfStatementInspectionTool() { 21 | super(new EmptyIfStatementRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/EqualsOverloadedInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.EqualsOverloadedRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class EqualsOverloadedInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.EqualsOverloadedRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public EqualsOverloadedInspectionTool() { 21 | super(new EqualsOverloadedRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/junit/JUnitPublicFieldInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.junit; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.junit.JUnitPublicFieldRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class JUnitPublicFieldInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.junit.JUnitPublicFieldRule 17 | 18 | public static final String GROUP = "Junit"; 19 | 20 | public JUnitPublicFieldInspectionTool() { 21 | super(new JUnitPublicFieldRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/security/InsecureRandomInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.security; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.security.InsecureRandomRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class InsecureRandomInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.security.InsecureRandomRule 17 | 18 | public static final String GROUP = "Security"; 19 | 20 | public InsecureRandomInspectionTool() { 21 | super(new InsecureRandomRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/security/ObjectFinalizeInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.security; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.security.ObjectFinalizeRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ObjectFinalizeInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.security.ObjectFinalizeRule 17 | 18 | public static final String GROUP = "Security"; 19 | 20 | public ObjectFinalizeInspectionTool() { 21 | super(new ObjectFinalizeRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/BooleanGetBooleanInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.BooleanGetBooleanRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class BooleanGetBooleanInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.BooleanGetBooleanRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public BooleanGetBooleanInspectionTool() { 21 | super(new BooleanGetBooleanRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/DuplicateSetValueInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.DuplicateSetValueRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class DuplicateSetValueInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.DuplicateSetValueRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public DuplicateSetValueInspectionTool() { 21 | super(new DuplicateSetValueRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/EmptyFinallyBlockInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.EmptyFinallyBlockRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class EmptyFinallyBlockInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.EmptyFinallyBlockRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public EmptyFinallyBlockInspectionTool() { 21 | super(new EmptyFinallyBlockRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/EmptyForStatementInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.EmptyForStatementRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class EmptyForStatementInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.EmptyForStatementRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public EmptyForStatementInspectionTool() { 21 | super(new EmptyForStatementRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/EqualsAndHashCodeInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.EqualsAndHashCodeRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class EqualsAndHashCodeInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.EqualsAndHashCodeRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public EqualsAndHashCodeInspectionTool() { 21 | super(new EqualsAndHashCodeRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/IntegerGetIntegerInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.IntegerGetIntegerRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class IntegerGetIntegerInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.IntegerGetIntegerRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public IntegerGetIntegerInspectionTool() { 21 | super(new IntegerGetIntegerRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/convention/CompileStaticInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.convention; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.convention.CompileStaticRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class CompileStaticInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.convention.CompileStaticRule 17 | 18 | public static final String GROUP = "Convention"; 19 | 20 | public CompileStaticInspectionTool() { 21 | super(new CompileStaticRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/design/LocaleSetDefaultInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.design; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.design.LocaleSetDefaultRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class LocaleSetDefaultInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.design.LocaleSetDefaultRule 17 | 18 | public static final String GROUP = "Design"; 19 | 20 | public LocaleSetDefaultInspectionTool() { 21 | super(new LocaleSetDefaultRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/formatting/SpaceAfterForInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.formatting; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.formatting.SpaceAfterForRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class SpaceAfterForInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.formatting.SpaceAfterForRule 17 | 18 | public static final String GROUP = "Formatting"; 19 | 20 | public SpaceAfterForInspectionTool() { 21 | super(new SpaceAfterForRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/groovyism/UseCollectManyInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.groovyism; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.groovyism.UseCollectManyRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class UseCollectManyInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.groovyism.UseCollectManyRule 17 | 18 | public static final String GROUP = "Groovyism"; 19 | 20 | public UseCollectManyInspectionTool() { 21 | super(new UseCollectManyRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/logging/MultipleLoggersInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.logging; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.logging.MultipleLoggersRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class MultipleLoggersInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.logging.MultipleLoggersRule 17 | 18 | public static final String GROUP = "Logging"; 19 | 20 | public MultipleLoggersInspectionTool() { 21 | super(new MultipleLoggersRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/logging/PrintStackTraceInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.logging; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.logging.PrintStackTraceRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class PrintStackTraceInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.logging.PrintStackTraceRule 17 | 18 | public static final String GROUP = "Logging"; 19 | 20 | public PrintStackTraceInspectionTool() { 21 | super(new PrintStackTraceRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/braces/IfStatementBracesInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.braces; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.braces.IfStatementBracesRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class IfStatementBracesInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.braces.IfStatementBracesRule 17 | 18 | public static final String GROUP = "Braces"; 19 | 20 | public IfStatementBracesInspectionTool() { 21 | super(new IfStatementBracesRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/convention/InvertedIfElseInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.convention; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.convention.InvertedIfElseRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class InvertedIfElseInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.convention.InvertedIfElseRule 17 | 18 | public static final String GROUP = "Convention"; 19 | 20 | public InvertedIfElseInspectionTool() { 21 | super(new InvertedIfElseRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/convention/NoJavaUtilDateInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.convention; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.convention.NoJavaUtilDateRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class NoJavaUtilDateInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.convention.NoJavaUtilDateRule 17 | 18 | public static final String GROUP = "Convention"; 19 | 20 | public NoJavaUtilDateInspectionTool() { 21 | super(new NoJavaUtilDateRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/dry/DuplicateMapLiteralInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.dry; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.dry.DuplicateMapLiteralRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class DuplicateMapLiteralInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.dry.DuplicateMapLiteralRule 17 | 18 | public static final String GROUP = "Dry"; 19 | 20 | public DuplicateMapLiteralInspectionTool() { 21 | super(new DuplicateMapLiteralRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/exceptions/CatchExceptionInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.exceptions; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.exceptions.CatchExceptionRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class CatchExceptionInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.exceptions.CatchExceptionRule 17 | 18 | public static final String GROUP = "Exceptions"; 19 | 20 | public CatchExceptionInspectionTool() { 21 | super(new CatchExceptionRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/exceptions/CatchThrowableInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.exceptions; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.exceptions.CatchThrowableRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class CatchThrowableInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.exceptions.CatchThrowableRule 17 | 18 | public static final String GROUP = "Exceptions"; 19 | 20 | public CatchThrowableInspectionTool() { 21 | super(new CatchThrowableRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/exceptions/ThrowExceptionInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.exceptions; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.exceptions.ThrowExceptionRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ThrowExceptionInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.exceptions.ThrowExceptionRule 17 | 18 | public static final String GROUP = "Exceptions"; 19 | 20 | public ThrowExceptionInspectionTool() { 21 | super(new ThrowExceptionRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/exceptions/ThrowThrowableInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.exceptions; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.exceptions.ThrowThrowableRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ThrowThrowableInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.exceptions.ThrowThrowableRule 17 | 18 | public static final String GROUP = "Exceptions"; 19 | 20 | public ThrowThrowableInspectionTool() { 21 | super(new ThrowThrowableRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/jenkins/ClosureInGStringInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.jenkins; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.jenkins.ClosureInGStringRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ClosureInGStringInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.jenkins.ClosureInGStringRule 17 | 18 | public static final String GROUP = "Jenkins"; 19 | 20 | public ClosureInGStringInspectionTool() { 21 | super(new ClosureInGStringRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/BrokenOddnessCheckInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.BrokenOddnessCheckRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class BrokenOddnessCheckInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.BrokenOddnessCheckRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public BrokenOddnessCheckInspectionTool() { 21 | super(new BrokenOddnessCheckRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/ComparisonWithSelfInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.ComparisonWithSelfRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ComparisonWithSelfInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.ComparisonWithSelfRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public ComparisonWithSelfInspectionTool() { 21 | super(new ComparisonWithSelfRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/groovyism/GStringAsMapKeyInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.groovyism; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.groovyism.GStringAsMapKeyRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class GStringAsMapKeyInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.groovyism.GStringAsMapKeyRule 17 | 18 | public static final String GROUP = "Groovyism"; 19 | 20 | public GStringAsMapKeyInspectionTool() { 21 | super(new GStringAsMapKeyRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/unnecessary/AddEmptyStringInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.unnecessary; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.unnecessary.AddEmptyStringRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class AddEmptyStringInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.unnecessary.AddEmptyStringRule 17 | 18 | public static final String GROUP = "Unnecessary"; 19 | 20 | public AddEmptyStringInspectionTool() { 21 | super(new AddEmptyStringRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/basic/EmptyWhileStatementInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.basic; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.basic.EmptyWhileStatementRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class EmptyWhileStatementInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.basic.EmptyWhileStatementRule 17 | 18 | public static final String GROUP = "Basic"; 19 | 20 | public EmptyWhileStatementInspectionTool() { 21 | super(new EmptyWhileStatementRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/braces/ForStatementBracesInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.braces; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.braces.ForStatementBracesRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class ForStatementBracesInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.braces.ForStatementBracesRule 17 | 18 | public static final String GROUP = "Braces"; 19 | 20 | public ForStatementBracesInspectionTool() { 21 | super(new ForStatementBracesRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/dry/DuplicateListLiteralInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.dry; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.dry.DuplicateListLiteralRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class DuplicateListLiteralInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.dry.DuplicateListLiteralRule 17 | 18 | public static final String GROUP = "Dry"; 19 | 20 | public DuplicateListLiteralInspectionTool() { 21 | super(new DuplicateListLiteralRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/formatting/SpaceAfterCatchInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.formatting; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.formatting.SpaceAfterCatchRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class SpaceAfterCatchInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.formatting.SpaceAfterCatchRule 17 | 18 | public static final String GROUP = "Formatting"; 19 | 20 | public SpaceAfterCatchInspectionTool() { 21 | super(new SpaceAfterCatchRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/formatting/SpaceAfterCommaInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.formatting; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.formatting.SpaceAfterCommaRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class SpaceAfterCommaInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.formatting.SpaceAfterCommaRule 17 | 18 | public static final String GROUP = "Formatting"; 19 | 20 | public SpaceAfterCommaInspectionTool() { 21 | super(new SpaceAfterCommaRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/formatting/SpaceAfterWhileInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.formatting; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.formatting.SpaceAfterWhileRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class SpaceAfterWhileInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.formatting.SpaceAfterWhileRule 17 | 18 | public static final String GROUP = "Formatting"; 19 | 20 | public SpaceAfterWhileInspectionTool() { 21 | super(new SpaceAfterWhileRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/codenarc/idea/inspections/groovyism/UseCollectNestedInspectionTool.java: -------------------------------------------------------------------------------- 1 | package org.codenarc.idea.inspections.groovyism; 2 | 3 | import com.intellij.codeInspection.LocalQuickFix; 4 | import com.intellij.psi.PsiElement; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import javax.annotation.Generated; 8 | import org.codenarc.idea.CodeNarcInspectionTool; 9 | import org.codenarc.rule.Violation; 10 | import org.codenarc.rule.groovyism.UseCollectNestedRule; 11 | import org.jspecify.annotations.NonNull; 12 | 13 | @Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely") 14 | public class UseCollectNestedInspectionTool extends CodeNarcInspectionTool { 15 | 16 | // this code has been generated from org.codenarc.rule.groovyism.UseCollectNestedRule 17 | 18 | public static final String GROUP = "Groovyism"; 19 | 20 | public UseCollectNestedInspectionTool() { 21 | super(new UseCollectNestedRule()); 22 | applyDefaultConfiguration(getRule()); 23 | } 24 | 25 | @Override 26 | public String getRuleset() { 27 | return GROUP; 28 | } 29 | 30 | 31 | public void setApplyToClassNames(String value) { 32 | getRule().setApplyToClassNames(value); 33 | } 34 | 35 | public String getApplyToClassNames() { 36 | return getRule().getApplyToClassNames(); 37 | } 38 | 39 | 40 | public void setDoNotApplyToClassNames(String value) { 41 | getRule().setDoNotApplyToClassNames(value); 42 | } 43 | 44 | public String getDoNotApplyToClassNames() { 45 | return getRule().getDoNotApplyToClassNames(); 46 | } 47 | 48 | // custom code can be written after this line and it will be preserved during the regeneration 49 | 50 | @Override 51 | protected @NonNull Collection getQuickFixesFor( 52 | @NonNull Violation violation, 53 | @NonNull PsiElement violatingElement 54 | ) { 55 | return Collections.emptyList(); 56 | } 57 | 58 | } 59 | --------------------------------------------------------------------------------