diff --git a/src/dscanner/analysis/alias_syntax_check.d b/src/dscanner/analysis/alias_syntax_check.d index 515fa34..8989ffa 100644 --- a/src/dscanner/analysis/alias_syntax_check.d +++ b/src/dscanner/analysis/alias_syntax_check.d @@ -12,7 +12,7 @@ import dscanner.analysis.base; /** * Checks for uses of the old alias syntax. */ -class AliasSyntaxCheck : BaseAnalyzer +final class AliasSyntaxCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/allman.d b/src/dscanner/analysis/allman.d index dcfeb71..239faf0 100644 --- a/src/dscanner/analysis/allman.d +++ b/src/dscanner/analysis/allman.d @@ -25,7 +25,7 @@ if (param < 0) } ------------ */ -class AllManCheck : BaseAnalyzer +final class AllManCheck : BaseAnalyzer { /// this(string fileName, const(Token)[] tokens, bool skipTests = false) diff --git a/src/dscanner/analysis/asm_style.d b/src/dscanner/analysis/asm_style.d index 30dd495..48da513 100644 --- a/src/dscanner/analysis/asm_style.d +++ b/src/dscanner/analysis/asm_style.d @@ -16,7 +16,7 @@ import dsymbol.scope_ : Scope; * Checks for confusing asm expressions. * See_also: $(LINK https://issues.dlang.org/show_bug.cgi?id=9738) */ -class AsmStyleCheck : BaseAnalyzer +final class AsmStyleCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/assert_without_msg.d b/src/dscanner/analysis/assert_without_msg.d index 476746d..c01dc5d 100644 --- a/src/dscanner/analysis/assert_without_msg.d +++ b/src/dscanner/analysis/assert_without_msg.d @@ -16,7 +16,7 @@ import std.algorithm; /** * Check that all asserts have an explanatory message. */ -class AssertWithoutMessageCheck : BaseAnalyzer +final class AssertWithoutMessageCheck : BaseAnalyzer { enum string KEY = "dscanner.style.assert_without_msg"; enum string MESSAGE = "An assert should have an explanatory message"; diff --git a/src/dscanner/analysis/auto_ref_assignment.d b/src/dscanner/analysis/auto_ref_assignment.d index 96f20c7..d6495c9 100644 --- a/src/dscanner/analysis/auto_ref_assignment.d +++ b/src/dscanner/analysis/auto_ref_assignment.d @@ -12,7 +12,7 @@ import dscanner.analysis.base; /** * Checks for assignment to auto-ref function parameters. */ -class AutoRefAssignmentCheck : BaseAnalyzer +final class AutoRefAssignmentCheck : BaseAnalyzer { /// this(string fileName, bool skipTests = false) diff --git a/src/dscanner/analysis/builtin_property_names.d b/src/dscanner/analysis/builtin_property_names.d index 2c49636..d7de74a 100644 --- a/src/dscanner/analysis/builtin_property_names.d +++ b/src/dscanner/analysis/builtin_property_names.d @@ -27,7 +27,7 @@ import std.algorithm : map; * } * --- */ -class BuiltinPropertyNameCheck : BaseAnalyzer +final class BuiltinPropertyNameCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/comma_expression.d b/src/dscanner/analysis/comma_expression.d index 6bdbbfa..9ce4589 100644 --- a/src/dscanner/analysis/comma_expression.d +++ b/src/dscanner/analysis/comma_expression.d @@ -13,7 +13,7 @@ import dsymbol.scope_; /** * Check for uses of the comma expression. */ -class CommaExpressionCheck : BaseAnalyzer +final class CommaExpressionCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/constructors.d b/src/dscanner/analysis/constructors.d index 961f553..7efbd4d 100644 --- a/src/dscanner/analysis/constructors.d +++ b/src/dscanner/analysis/constructors.d @@ -7,7 +7,7 @@ import dscanner.analysis.base; import dscanner.analysis.helpers; import dsymbol.scope_ : Scope; -class ConstructorCheck : BaseAnalyzer +final class ConstructorCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/del.d b/src/dscanner/analysis/del.d index e73fdb5..6162470 100644 --- a/src/dscanner/analysis/del.d +++ b/src/dscanner/analysis/del.d @@ -14,7 +14,7 @@ import dsymbol.scope_; /** * Checks for use of the deprecated 'delete' keyword */ -class DeleteCheck : BaseAnalyzer +final class DeleteCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/duplicate_attribute.d b/src/dscanner/analysis/duplicate_attribute.d index 8980c71..c1292fc 100644 --- a/src/dscanner/analysis/duplicate_attribute.d +++ b/src/dscanner/analysis/duplicate_attribute.d @@ -17,7 +17,7 @@ import dsymbol.scope_ : Scope; * Checks for duplicate attributes such as @property, @safe, * @trusted, @system, pure, and nothrow */ -class DuplicateAttributeCheck : BaseAnalyzer +final class DuplicateAttributeCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/enumarrayliteral.d b/src/dscanner/analysis/enumarrayliteral.d index d63bad6..68e25ca 100644 --- a/src/dscanner/analysis/enumarrayliteral.d +++ b/src/dscanner/analysis/enumarrayliteral.d @@ -15,7 +15,7 @@ void doNothing(string, size_t, size_t, string, bool) { } -class EnumArrayLiteralCheck : BaseAnalyzer +final class EnumArrayLiteralCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/explicitly_annotated_unittests.d b/src/dscanner/analysis/explicitly_annotated_unittests.d index af5d396..87e830d 100644 --- a/src/dscanner/analysis/explicitly_annotated_unittests.d +++ b/src/dscanner/analysis/explicitly_annotated_unittests.d @@ -13,7 +13,7 @@ import std.stdio; /** * Requires unittests to be explicitly annotated with either @safe or @system */ -class ExplicitlyAnnotatedUnittestCheck : BaseAnalyzer +final class ExplicitlyAnnotatedUnittestCheck : BaseAnalyzer { enum string KEY = "dscanner.style.explicitly_annotated_unittest"; enum string MESSAGE = "A unittest should be annotated with at least @safe or @system"; diff --git a/src/dscanner/analysis/fish.d b/src/dscanner/analysis/fish.d index 5414cfb..d09f4e2 100644 --- a/src/dscanner/analysis/fish.d +++ b/src/dscanner/analysis/fish.d @@ -15,7 +15,7 @@ import dsymbol.scope_ : Scope; /** * Checks for use of the deprecated floating point comparison operators. */ -class FloatOperatorCheck : BaseAnalyzer +final class FloatOperatorCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/function_attributes.d b/src/dscanner/analysis/function_attributes.d index 855f025..2c5ce9a 100644 --- a/src/dscanner/analysis/function_attributes.d +++ b/src/dscanner/analysis/function_attributes.d @@ -21,7 +21,7 @@ import dsymbol.scope_; * const int getStuff() {} * --- */ -class FunctionAttributeCheck : BaseAnalyzer +final class FunctionAttributeCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/has_public_example.d b/src/dscanner/analysis/has_public_example.d index 9c305fa..cdbe6dc 100644 --- a/src/dscanner/analysis/has_public_example.d +++ b/src/dscanner/analysis/has_public_example.d @@ -16,7 +16,7 @@ import std.stdio; * Checks for public declarations without a documented unittests. * For now, variable and enum declarations aren't checked. */ -class HasPublicExampleCheck : BaseAnalyzer +final class HasPublicExampleCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/if_constraints_indent.d b/src/dscanner/analysis/if_constraints_indent.d index 8ec348b..45087e3 100644 --- a/src/dscanner/analysis/if_constraints_indent.d +++ b/src/dscanner/analysis/if_constraints_indent.d @@ -15,7 +15,7 @@ import std.range; /** Checks whether all if constraints have the same indention as their declaration. */ -class IfConstraintsIndentCheck : BaseAnalyzer +final class IfConstraintsIndentCheck : BaseAnalyzer { /// this(string fileName, const(Token)[] tokens, bool skipTests = false) diff --git a/src/dscanner/analysis/if_statements.d b/src/dscanner/analysis/if_statements.d index 4b47cd4..7358d37 100644 --- a/src/dscanner/analysis/if_statements.d +++ b/src/dscanner/analysis/if_statements.d @@ -10,7 +10,7 @@ import dparse.formatter; import dscanner.analysis.base; import dsymbol.scope_ : Scope; -class IfStatementCheck : BaseAnalyzer +final class IfStatementCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; this(string fileName, const(Scope)* sc, bool skipTests = false) diff --git a/src/dscanner/analysis/ifelsesame.d b/src/dscanner/analysis/ifelsesame.d index f87fe36..57f26f9 100644 --- a/src/dscanner/analysis/ifelsesame.d +++ b/src/dscanner/analysis/ifelsesame.d @@ -20,7 +20,7 @@ import dsymbol.scope_ : Scope; * $(LI == expressions where the left and right are the same) * ) */ -class IfElseSameCheck : BaseAnalyzer +final class IfElseSameCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/imports_sortedness.d b/src/dscanner/analysis/imports_sortedness.d index bd84fd2..0d7cd3b 100644 --- a/src/dscanner/analysis/imports_sortedness.d +++ b/src/dscanner/analysis/imports_sortedness.d @@ -13,7 +13,7 @@ import std.stdio; /** * Checks the sortedness of module imports */ -class ImportSortednessCheck : BaseAnalyzer +final class ImportSortednessCheck : BaseAnalyzer { enum string KEY = "dscanner.style.imports_sortedness"; enum string MESSAGE = "The imports are not sorted in alphabetical order"; diff --git a/src/dscanner/analysis/incorrect_infinite_range.d b/src/dscanner/analysis/incorrect_infinite_range.d index cca0025..499af70 100644 --- a/src/dscanner/analysis/incorrect_infinite_range.d +++ b/src/dscanner/analysis/incorrect_infinite_range.d @@ -13,7 +13,7 @@ import dparse.lexer; /** * Checks for incorrect infinite range definitions */ -class IncorrectInfiniteRangeCheck : BaseAnalyzer +final class IncorrectInfiniteRangeCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/label_var_same_name_check.d b/src/dscanner/analysis/label_var_same_name_check.d index 88347b4..1e1f298 100644 --- a/src/dscanner/analysis/label_var_same_name_check.d +++ b/src/dscanner/analysis/label_var_same_name_check.d @@ -13,7 +13,7 @@ import dscanner.analysis.helpers; /** * Checks for labels and variables that have the same name. */ -class LabelVarNameCheck : BaseAnalyzer +final class LabelVarNameCheck : BaseAnalyzer { this(string fileName, const(Scope)* sc, bool skipTests = false) { diff --git a/src/dscanner/analysis/lambda_return_check.d b/src/dscanner/analysis/lambda_return_check.d index ab0a7d2..fed78bd 100644 --- a/src/dscanner/analysis/lambda_return_check.d +++ b/src/dscanner/analysis/lambda_return_check.d @@ -9,7 +9,7 @@ import dparse.ast; import dparse.lexer; import dscanner.analysis.base; -class LambdaReturnCheck : BaseAnalyzer +final class LambdaReturnCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/length_subtraction.d b/src/dscanner/analysis/length_subtraction.d index e220373..4c7a0d1 100644 --- a/src/dscanner/analysis/length_subtraction.d +++ b/src/dscanner/analysis/length_subtraction.d @@ -16,7 +16,7 @@ import dsymbol.scope_; /** * Checks for subtraction from a .length property. This is usually a bug. */ -class LengthSubtractionCheck : BaseAnalyzer +final class LengthSubtractionCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/line_length.d b/src/dscanner/analysis/line_length.d index bab42a8..97d3f07 100644 --- a/src/dscanner/analysis/line_length.d +++ b/src/dscanner/analysis/line_length.d @@ -15,7 +15,7 @@ import std.typecons : tuple, Tuple; /** * Checks for lines longer than 120 characters */ -class LineLengthCheck : BaseAnalyzer +final class LineLengthCheck : BaseAnalyzer { /// this(string fileName, const(Token)[] tokens, bool skipTests = false) diff --git a/src/dscanner/analysis/local_imports.d b/src/dscanner/analysis/local_imports.d index cb08333..0da9840 100644 --- a/src/dscanner/analysis/local_imports.d +++ b/src/dscanner/analysis/local_imports.d @@ -16,7 +16,7 @@ import dsymbol.scope_; * Checks for local imports that import all symbols. * See_also: $(LINK https://issues.dlang.org/show_bug.cgi?id=10378) */ -class LocalImportCheck : BaseAnalyzer +final class LocalImportCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/logic_precedence.d b/src/dscanner/analysis/logic_precedence.d index 8eac0b7..7e474d3 100644 --- a/src/dscanner/analysis/logic_precedence.d +++ b/src/dscanner/analysis/logic_precedence.d @@ -19,7 +19,7 @@ import dsymbol.scope_; * if (a && (b || c)) // good * --- */ -class LogicPrecedenceCheck : BaseAnalyzer +final class LogicPrecedenceCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/numbers.d b/src/dscanner/analysis/numbers.d index c20986c..6e7b86b 100644 --- a/src/dscanner/analysis/numbers.d +++ b/src/dscanner/analysis/numbers.d @@ -16,7 +16,7 @@ import dsymbol.scope_ : Scope; /** * Checks for long and hard-to-read number literals */ -class NumberStyleCheck : BaseAnalyzer +final class NumberStyleCheck : BaseAnalyzer { public: alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/objectconst.d b/src/dscanner/analysis/objectconst.d index 50f0850..c20bc5c 100644 --- a/src/dscanner/analysis/objectconst.d +++ b/src/dscanner/analysis/objectconst.d @@ -17,7 +17,7 @@ import dsymbol.scope_ : Scope; * Checks that opEquals, opCmp, toHash, 'opCast', and toString are either const, * immutable, or inout. */ -class ObjectConstCheck : BaseAnalyzer +final class ObjectConstCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/opequals_without_tohash.d b/src/dscanner/analysis/opequals_without_tohash.d index 5575e32..a1b4e84 100644 --- a/src/dscanner/analysis/opequals_without_tohash.d +++ b/src/dscanner/analysis/opequals_without_tohash.d @@ -16,7 +16,7 @@ import dsymbol.scope_ : Scope; * Checks for when a class/struct has the method opEquals without toHash, or * toHash without opEquals. */ -class OpEqualsWithoutToHashCheck : BaseAnalyzer +final class OpEqualsWithoutToHashCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/pokemon.d b/src/dscanner/analysis/pokemon.d index 3bc5de3..ef594ae 100644 --- a/src/dscanner/analysis/pokemon.d +++ b/src/dscanner/analysis/pokemon.d @@ -23,7 +23,7 @@ import dsymbol.scope_ : Scope; * } * --- */ -class PokemonExceptionCheck : BaseAnalyzer +final class PokemonExceptionCheck : BaseAnalyzer { enum MESSAGE = "Catching Error or Throwable is almost always a bad idea."; enum string KEY = "dscanner.suspicious.catch_em_all"; diff --git a/src/dscanner/analysis/properly_documented_public_functions.d b/src/dscanner/analysis/properly_documented_public_functions.d index d24909d..8b570b2 100644 --- a/src/dscanner/analysis/properly_documented_public_functions.d +++ b/src/dscanner/analysis/properly_documented_public_functions.d @@ -21,7 +21,7 @@ import std.stdio; - Ddoc params entries without a parameter trigger warnings as well - RETURNS: (except if it's void, only functions) */ -class ProperlyDocumentedPublicFunctions : BaseAnalyzer +final class ProperlyDocumentedPublicFunctions : BaseAnalyzer { enum string MISSING_PARAMS_KEY = "dscanner.style.doc_missing_params"; enum string MISSING_PARAMS_MESSAGE = "Parameter %s isn't documented in the `Params` section."; diff --git a/src/dscanner/analysis/range.d b/src/dscanner/analysis/range.d index 20fc058..bfc5581 100644 --- a/src/dscanner/analysis/range.d +++ b/src/dscanner/analysis/range.d @@ -16,7 +16,7 @@ import dsymbol.scope_ : Scope; * Checks for .. expressions where the left side is larger than the right. This * is almost always a mistake. */ -class BackwardsRangeCheck : BaseAnalyzer +final class BackwardsRangeCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/redundant_attributes.d b/src/dscanner/analysis/redundant_attributes.d index 7aca111..d7bfab2 100644 --- a/src/dscanner/analysis/redundant_attributes.d +++ b/src/dscanner/analysis/redundant_attributes.d @@ -17,7 +17,7 @@ import std.range : empty, front, walkLength; /** * Checks for redundant attributes. At the moment only visibility attributes. */ -class RedundantAttributesCheck : BaseAnalyzer +final class RedundantAttributesCheck : BaseAnalyzer { this(string fileName, const(Scope)* sc, bool skipTests = false) { diff --git a/src/dscanner/analysis/redundant_parens.d b/src/dscanner/analysis/redundant_parens.d index c4af077..b2bf1bd 100644 --- a/src/dscanner/analysis/redundant_parens.d +++ b/src/dscanner/analysis/redundant_parens.d @@ -13,7 +13,7 @@ import dsymbol.scope_ : Scope; /** * Checks for redundant parenthesis */ -class RedundantParenCheck : BaseAnalyzer +final class RedundantParenCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/redundant_storage_class.d b/src/dscanner/analysis/redundant_storage_class.d index f9bb2be..af90b9c 100644 --- a/src/dscanner/analysis/redundant_storage_class.d +++ b/src/dscanner/analysis/redundant_storage_class.d @@ -16,7 +16,7 @@ import dsymbol.scope_ : Scope; /** * Checks for redundant storage classes such immutable and __gshared, static and __gshared */ -class RedundantStorageClassCheck : BaseAnalyzer +final class RedundantStorageClassCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; enum string REDUNDANT_VARIABLE_ATTRIBUTES = "Variable declaration for `%s` has redundant attributes (%-(`%s`%|, %))."; diff --git a/src/dscanner/analysis/static_if_else.d b/src/dscanner/analysis/static_if_else.d index f23199d..df7db9d 100644 --- a/src/dscanner/analysis/static_if_else.d +++ b/src/dscanner/analysis/static_if_else.d @@ -22,7 +22,7 @@ import dscanner.utils : safeAccess; * * However, it's more likely that this is a mistake. */ -class StaticIfElse : BaseAnalyzer +final class StaticIfElse : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/stats_collector.d b/src/dscanner/analysis/stats_collector.d index 5056849..a2fdee4 100644 --- a/src/dscanner/analysis/stats_collector.d +++ b/src/dscanner/analysis/stats_collector.d @@ -9,7 +9,7 @@ import dparse.ast; import dparse.lexer; import dscanner.analysis.base; -class StatsCollector : BaseAnalyzer +final class StatsCollector : BaseAnalyzer { alias visit = ASTVisitor.visit; diff --git a/src/dscanner/analysis/trust_too_much.d b/src/dscanner/analysis/trust_too_much.d index 7e469dd..8d7d826 100644 --- a/src/dscanner/analysis/trust_too_much.d +++ b/src/dscanner/analysis/trust_too_much.d @@ -14,7 +14,7 @@ import dsymbol.scope_; /** * Checks that `@trusted` is only applied to a a single function */ -class TrustTooMuchCheck : BaseAnalyzer +final class TrustTooMuchCheck : BaseAnalyzer { private: diff --git a/src/dscanner/analysis/undocumented.d b/src/dscanner/analysis/undocumented.d index 1438435..01f5584 100644 --- a/src/dscanner/analysis/undocumented.d +++ b/src/dscanner/analysis/undocumented.d @@ -17,7 +17,7 @@ import std.stdio; * Checks for undocumented public declarations. Ignores some operator overloads, * main functions, and functions whose name starts with "get" or "set". */ -class UndocumentedDeclarationCheck : BaseAnalyzer +final class UndocumentedDeclarationCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/unmodified.d b/src/dscanner/analysis/unmodified.d index d8b3406..579a057 100644 --- a/src/dscanner/analysis/unmodified.d +++ b/src/dscanner/analysis/unmodified.d @@ -14,7 +14,7 @@ import dparse.lexer; /** * Checks for variables that could have been declared const or immutable */ -class UnmodifiedFinder : BaseAnalyzer +final class UnmodifiedFinder : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/unused.d b/src/dscanner/analysis/unused.d index 319639a..19c7a0f 100644 --- a/src/dscanner/analysis/unused.d +++ b/src/dscanner/analysis/unused.d @@ -16,7 +16,7 @@ import std.algorithm : all; /** * Checks for unused variables. */ -class UnusedVariableCheck : BaseAnalyzer +final class UnusedVariableCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/useless_assert.d b/src/dscanner/analysis/useless_assert.d index 8f173ea..af9d7e6 100644 --- a/src/dscanner/analysis/useless_assert.d +++ b/src/dscanner/analysis/useless_assert.d @@ -23,7 +23,7 @@ auto filterChars(string chars, S)(S str) /** * Checks for asserts that always succeed */ -class UselessAssertCheck : BaseAnalyzer +final class UselessAssertCheck : BaseAnalyzer { alias visit = BaseAnalyzer.visit; diff --git a/src/dscanner/analysis/vcall_in_ctor.d b/src/dscanner/analysis/vcall_in_ctor.d index efd1a44..85bfa93 100644 --- a/src/dscanner/analysis/vcall_in_ctor.d +++ b/src/dscanner/analysis/vcall_in_ctor.d @@ -19,7 +19,7 @@ import std.range: retro; * When not used carefully, virtual calls from constructors can lead to a call * in a derived instance that's not yet constructed. */ -class VcallCtorChecker : BaseAnalyzer +final class VcallCtorChecker : BaseAnalyzer { alias visit = BaseAnalyzer.visit;