- Fixes CI configuration.
- Updates Type parameters names regular expression.
- Updates README files.
- Adds some prepositions to regular expressions for names:
at
,by
,in
,on
,to
&up
. - Updates README files.
- Updates the Type Parameters names rule with an additional pattern to allow to given more context in the name.
- Updates README files.
- eslint-plugin-base-style-config changes
- Updates README files.
- Moves
js
style configuration files to its own project, it was hard to use this configuration files in npm projects (no gradle projects).js
andjava
project will have from now on each one its own version.
- typescript-eslint now extends from eslint rules
- Improves maintainability.
- Improves eslint rule
id-match
, allowing$
character at the beginning. - Removes
@typescript-eslint/indent
was colliding with eslintindent
. - Removes
@typescript-eslint/no-angle-bracket-type-assertion
(It's no available anymore since 2.0.0).- Adds
@typescript-eslint/consistent-type-assertions
.
- Adds
- Removes eslint rule
yoda
, same asquotes
&semicolon
should be enforce based on language and team, because it can also harm maintainability. - Renames
coding-rules.xml
tojava-rules.xml
. - Renames
coding-checks.xml
tojava-checks.xml
. - Updates README file.
- Adds rules:
UseOnlyWillFamilyMethodsWhenStubbing
,UseOnlyThenFamilyMethodsWhenMocking
,DoNotMixBDDandTDD
andPreferBDDTesting
. - Renames
UseOnlyDoFamilyMethodsWhenMocking
rule toUseDoFamilyMethodsWhenStubbing
. - Fixes
LineLength
Codenarc rule, it was not ignoring single quoted strings. - Updates README file.
- Standardize naming convention for Java, Groovy and JS:
- Updates Codenarc rules:
ClassName
,FieldName
,MethodName
,InterfaceName
,ParameterName
,PropertyName
andVariableName
. - Updates Checkstyle rules:
LocalFinalVariableName
,MemberName
,MethodName
,ParameterName
andTypeName
. - Adds Checkstyle rules:
LambdaParameterName
,ConstantName
. - Adds Custom Checkstyle rules:
ConstantNameLength
andTestTypeName
. - Adds Custom Codenarc rules:
ConstantNameLength
,GradleVariableName
,GroovyTestClassName
andGroovyTestMethodName
. - Adds
MethodNamingConventions
PMD rule for checking Test files. - Adds
id-length
ESlint rule. - Adds
@typescript-eslint/generic-type-naming
rule. - Updates Checkstyle rules:
ClassTypeParameterName
,InterfaceTypeParameterName
andMethodTypeParameterName
. - Updates
id-match
ESlint rule. - Excludes PMD rules:
FieldNamingConventions
,FormalParameterNamingConventions
,GenericsNaming
,LocalVariableNamingConventions
,LongVariable
,ShortClassName
,ShortVariable
andShortMethodName
, cases which are now resolved by Checkstyle rules. - Adds required suppressions.
- Updates Codenarc rules:
- Updates
LineLength
Codenarc rule, to be synchronize with CheckstyleLineLength
rule.
- Updates
TooManyMethods
PMD rule andMethodCount
Codenarc rule to have a limit of 30 methods by class. - Updates
ParameterNumber
Checkstyle rule andTooManyFields
PMD rule to have be consistent with each other, having a limit of 7 fields by class and 7 parameters by method (including constructor).- Consequently,
max-params
ESlint rule andParameterCount
Codenarc rule were updated.
- Consequently,
- Updates README file.
- Breaking changes:
- Removes
.stylelintrc.json
. (It was not providing any real benefit, with only 1 rule, that conflict with the new convention of defining quotes style locally. Besides stylelint inheritance mechanism does not lend to an easy configuration). - Renames
back
folder tojava
, it gives more accurate context. - Renames
front
folder tojs
, it gives more accurate context.
- Removes
- Fixes compatibility with Checkstyle 8.21:
- Removes
PARAMETER_DEF
from RuleAnnotationLocationVariableAndParameter
. - Renames
AnnotationLocationVariableAndParameter
toAnnotationLocationVariable
.
- Removes
- Updates Method Size Rule for Checkstyle, CodeNarc & ESLint to 30 lines, which is readable without scrolling, this will increase Mantainability.
- Disables
CompileStatic
Codenarc rule, since in gradle code is not mandatory. - Adds a suppression for
e2eTest
/E2eTest
files inExcessiveImports
PMD rule. (E2E tests tends to be bigger files, having only one big E2E set is useful since loading time is usually bigger and slower than other types of test.) - Adds
.typescript-eslintrc.json
. - Updates VERSIONS_COMPATIBILITY table.
- Updates README file.
- Adds
object-curly-spacing
to eslint rules. - Improves
LineLength
Checkstyle rule to allow any number of specific tokens at start of the line. - Improves
UseMultilineTernaryOperator
Checkstyle rule to avoid a false-positive in Method references. - Improves
utilityClassPattern
inClassNamingConventions
PMD rule to also allow names defined only with one of established suffixes. - Adds
Mappers
suffix toutilityClassPattern
inClassNamingConventions
PMD rule. - Updates
EmptyLineSeparator
Checkstyle rule to allow empty line for packages definition. - Removes
ExcessiveMethodLength
PMD rule which is already checked by Checkstyle (which allows suppressions for tests). - Removes
LoggerIsNotStaticFinal
PMD rule which was preventing Logger injection, useful in some special cases. - Adds
SuppressWarningsFilter
to Checkstyle in order to be consistent with PMD, allowing suppressions of rule in code for special cases using@SuppressWarnings
annotation.
- Sets
"ignoreStrings": true, "ignoreTemplateLiterals": in
frommax-len
eslint rule, in order to be consistent with Checkstyle rules. - Updates README file.
- Add a new extension to be checked by Common rules:
pri
. - Removes
no-invalid-this
from eslint rules, it gives error on fat arrow member functions, should be set locally in each project as required. - Updates README file.
- Updates
LineLength
Checkstyle rule to allow long string. - Adjusts
UseMultilineTernaryOperator
Checkstyle/Codenarc rule to avoid some false positive when defining JSON strings. - Updates README file.
- Enforces 3/23 rule name length limits.
- Creates
LongMethodName
, a custom rule for CodeNarc rules to limit methods' name size. - Adds a suppressions for
ShortVariable
&ShortMethodName
PMD rules, to allow forid
,of
,k
&K
names. - Adds
id-match
eslint rule to enforce variable/field/method length and to allow forid
,of
,k
&K
names, as in backend rules. - Updates
LocalVariableName
&LocalFinalVariableName
Checkstyle rules andLocalVariableNamingConventions
PMD rule to be similar to frontendid-match
rule.
- Creates
- Adds new exceptions and markers to
spaced-comment
eslint rule, to allow special comments, like Flow comments. - Adds new extensions to be checked by Common rules:
.c
,.cpp
,flowconfig
,.h
,.hpp
,jsx
,mjs
,qml
,pro
&tsx
. - Updates README file.
- New rules for forcing public fields to be
final
:- Checkstyle: Updates
VisibilityModifier
rule to allow public final fields. - CodeNarc: Disables
PublicInstanceField
rule and Adds security rule set which containsNonFinalPublicField
rule.
- Checkstyle: Updates
- Sets priority to
0
(reported but does not cause a failure) forInstanceOf
rule from CodeNarc. - Fixes
AnnotateClassesWith@CompileStaticOr@TypeChecked
Codenarc rule, was not allowing comments. - Updates README file.
- Updates
EmptyLineSeparator
Checkstyle rule to allow fields on a class to be immediately below to each other without line between them. - Removes
forceStrictCondition
from Checkstyles which allows more freedom on indentation in order to get a code more similar to JS code. - Updates Gitlab CI configuration.
- Updates README file.
- Adds a new section
Code Style convention/tips
, in order to talk about some code style conventions which allow to improve Readability and also allow more code style consistency between Java, Groovy and JS code, since some rules between them cannot be exactly equally defined.
- Adds a new section
- Breaking changes:
- Changes
gradle
folder name togroovy
. - Changes
gradle-rules.groovy
file name togroovy-rules.groovy
. - Removes
"extends"
from.eslintrc.json
, it was not allowing for proper eslint config cascading. (It's not really "breaking" change, but the assumption that extends "eslint:recommended" is lost).
- Changes
- Adds the
design
rule set to Codenarc. - Strengthen import rules in Javascript, makes it more consistent with Defined Backend rules:
- Adds
sort-imports
,no-duplicate-imports
,no-new-require
andno-mixed-requires
.
- Adds
- Updates the eslint rules with
operator-linebreak
and the checkstyle checks withOperatorWrap
in order to check for line breaks on operators, operator must be on a new line, this with the intention of increasing Readability. - Updates Codenarc rules
SpaceAfterOpeningBrace
&SpaceBeforeClosingBrace
to ignore empty blocks. - Excludes Codenarc rule
UnnecessaryReturnKeyword
in order to increase Readability, some cases may be ok, like a method with one statement. Additionally, explicitly usingreturn
may increase code coverage values. - Excludes Codenarc rule
UnnecessaryCast
, in some case is required the use of a cast, e.g. an empty List of String[] as List<String>
. - Excludes new Codenarc rules
ClassEndsWithBlankLine
&ClassStartsWithBlankLine
. - Updates Codenarc exclusion to the new format using
(enabled: false)
, which allows for better rules version validation. - Adds Versions Compatibility Table.
- Updates Gitlab CI configuration.
- Upgrades Gradle to version 5.3.
- Updates README file.
- Removes
quotes
from eslint rules, should be set based on Backend language (or preference), for Groovy could be set to'
->"quotes": ["quotes", "single"]
, for C++, Java or QML could be set to"
->"quotes": ["quotes", "double"]
. - Removes
semi
from eslint rules, should be set based on Backend language (or preference), for Groovy or QML could be set to"semi": ["quotes", "never"]
, for C++ or Java could be set to"semi": ["quotes", "always"]
. - Updates
indent
eslint rules to enforce different indentation in function declarations. - Updates DOCTYPE's FPI and URI for checkstyle files.
- Adds new exceptions and markers to
spaced-comment
, to allow special comments, like Flow comments. - Updates README file.
- Removes
requires-jsdoc
from eslint rules, as in Java checks, favoring self-documented code and agile development, and not forcing documentation. - Adds exceptions and markers to
spaced-comment
, to allow special comments, like Flow comments. - Adds Smoke Tests for .eslintrc and .stylelintrc.
- Updates README file.
- Adds gitlab-ci.yml.
- Updates build.gradle.
- Updates README file.
- Removes
UnnecessaryPublicModifier
from CodeNarc's rules, switching between different languages, for example Java, Groovy and C ++, the change can become confusing with the default modifiers, this will allow using modifiers always, and forgetting what is the default value. - Changes
CustomImportOrder
check to give more freedom to import on java, due to all this mixing of programming languages can be in a project, it's "better" to only require alphabetical order. - Fixes
CallOnlyOneMethodPerLineForChainedCall
check, it was giving false positives for split calls and had some problems with Casts. - Fixes
UseMultilineTernaryOperator
Checkstyle check, it had some XML CDATA error. - Adds Tests for Regular Expressions.
- Updates
build.gradle
for adding respective dependencies.
- Updates
- Upgrades Gradle to version 5.2.1.
- Updates README file.
- Moves configuration files from config/ to src/config (may get confused with project config files).
- Fixes
UseMultilineTernaryOperator
, it was missing some cases for generics wildcards.
- Updates
AnnotateClassesWith@CompileStaticOr@TypeChecked
to also check for interfaces and traits. - Updates README file.
- Sets priority to
0
(reported but does not cause a failure) forGStringExpressionWithinString
rule from CodeNarc, it was causing some "false-positive", e.g.'--file ${npm_config_configFile}'
. - Updates README file.
- Sets priority to
0
(reported but does not cause a failure) forCouldBeElvis
rule from CodeNarc, it was causing some "false-positive", e.g.if (!object.field) object.field = value
value is required asobject.field = object.field ?: value
. - Fixes
SpaceBeforeOperator
andExactly1SpaceBeforeOperator
:- It was not checking
.&
operator. - Removes validations for
<
<<
<<<
>>
>>>
, some false-positive were arising.
- It was not checking
- Updates README file.
- Creates
CallOnlyOneMethodPerLineForChainedCall
, a custom rule for CodeNarc rules. - Creates
UseMultilineTernaryOperator
, a custom rule for CodeNarc rules. - Customizes PMD's
ClassNamingConventions
rule to allowFactory
suffix for Utility classes. - Customizes PMD's
FieldNamingConventions
rule:- To do real check for CamelCase.
- To allow Constant or Non-Constants conventions for
static final
fields..
- Customizes Checkstyle's
AbbreviationAsWordInName
rule to allow some freedom infinal
variables. - Improves Checkstyle's
CallOnlyOneMethodPerLineForChainedCall
rule. - Removes CodeNarc's
SpaceAroundOperator
rule, it is unstable for some patterns (produces some false-positive). - Creates
SpaceBeforeOperator
,SpaceAfterOperator
,Exactly1SpaceBeforeOperator
&Exactly1SpaceAfterOperator
rules for CodeNarc.- Substitutes
SpaceAroundOperator
rule.
- Substitutes
- Removes
MethodCount
for CodeNarc (missed this before). - Fixes
UseMultilineTernaryOperator
rule to ignore Wildcards. - Fixes Checkstyle's suppression file.
- Updates README file.
- Adds new rules to Checkstyle and CodeNarc:
NameOfTestsMustStartWithShould
to guaranteed that test methods name are prefixed with the wordshould
.
- Adds
AnonInnerLength
andVariableDeclarationUsageDistance
check to Backend Checkstyle checks. - Updates Method Size Rule for Checkstyle, CodeNarc & ESLint to 25 lines, which is readable without scrolling, this will increase Mantainability.
- Removes Method Count Rules and adds File Length rules for Checkstyle, CodeNarc & ESLint, to allow to be more functional oriented.
- Disables File Length Rule for test files in Checkstyle & CodeNarc.
- Actually does not remove
MethodCount
for Backend Checkstyle checks, but modifies in order to only check the count for public methods.
- Adds
TooManyFields
PMD rule to allow a maximum of 6 fields. - Enables Cyclomatic Complexity rule for Test files on Checkstyle & CodeNarc, in order to increase its Mantainability.
- Updates README file.
- Maven Group now is on all.shared.quality
- Fixes
AnnotateClassesWith@CompileStaticOr@TypeChecked
to also allow final classes. - Ignores some of the CodeNarc's rules for Test's files: UnnecessarySetter to allow mocking and verification.
- Excludes CodeNarc's rule 'UnnecessaryObjectReferences' for same reason that other languages do not recommend it, e.g.: performance, readability.
- Updates README file.
- Adds new rules to Checkstyle and CodeNarc:
UseOnlyMockOrSpyPrefixOnTestFiles
to use the 'mock
' or 'spy
' prefixes only on test's files.- This rule is ignored in Test's files.
UseOnlyDoFamilyMethodsWhenMocking
to use onlydo*
's family methods when using Mockito:doAnswer
,doCallRealMethod
,doNothing
,doReturn
&doThrow
(Mockito.when
andBDDMockito.given
have some "issues")
- Adds new rule
AnnotateClassesWith@CompileStaticOr@TypeChecked
to CodeNarc to check if Main class is annotated with@CompileStatic
or@TypeChecked
. - Customizes CodeNarc's rule
BracesForIfElse
to have same Stroustrup style that Checkstyle and ESLint. - Enables some CodeNarc's rules for
*.groovy
files and excludes to*.gradle
files:Indentation
,NoDef
,Indentation
andVariableTypeRequired
- Ignores some of the CodeNarc's rules for Test's files:
UnnecessaryGetter
to allow mocking. - Fixes some indentation issues in
coding-checks.xml
file. - Updates README file.
- Adds
DeclarationOrder
check to Backend Checkstyle checks. - Updates Suppressions for Test's files in Checkstyle:
- Adds suppressions for
CyclomaticComplexity
andMethodLength
checks.
- Adds suppressions for
- Updates CodeNarc's rulesets in order to:
- Be more similar to Backend Checkstyle checks: updates
rulesets/convention.xml
,rulesets/imports.xml
andrulesets/naming.xml
. - Ignore some rules for Test's files:
CyclomaticComplexity
,MethodCount
andMethodSize
.
- Be more similar to Backend Checkstyle checks: updates
- Sets priority to
0
(are reported but does not cause a failure) forDuplicateNumberLiteral
andDuplicateStringLiteral
rules from CodeNarc, at the moment of this change, these two rules did not allow for a configurable limit of allowed duplications, which turns these rules into impractical. - Excludes
ClassJavadoc
rule from CodeNarc'srulesets/formatting.xml
set of rules. - Excludes
CrapMetric
rule from CodeNarc'srulesets/size.xml
set of rules. - Updates README file.
- Excludes
AbcMetric
rule from CodeNarc'srulesets/size.xml
set of rules.
- Adds new rules to Checkstyle to check Stroustrup brackets on Backend:
LeftCurly
.RightCurly
.
- Adds new rules to ESLint mainly to get consistency between Backend's and Frontend's code:
max-classes-per-file
.max-lines
(to get a similar to Backend limit on method count).complexity
.
- Adds new set of rules to Codenarc mainly to get consistency between Backend's, Frontend's and Build's code:
rulesets/size.xml
.
- Modifies some ESLint's rules:
brace-style
is nowstroustrup
.
- Moves the Cyclomatic Complexity's check from PMD to Checkstyle.
- Sets parameters number limit for methods to 5.
- Improves the
AvoidFieldInjection
PMD custom rule, to check for inline annotations:@javax.inject.Inject
,@com.google.inject.Inject
and@org.springframework.beans.factory.annotation.Autowired
. - Fixes the
BeanMembersShouldSerialize
PMD core rule, to check fortransient
only when the class does implementsjava.io.Serializable
interface or has thejavax.persistence.Entity
Annotation. - Upgrades Gradle to version 4.10.2.
- Updates README file.