-
-
Notifications
You must be signed in to change notification settings - Fork 672
DScanner: Add a minimal .dscanner.ini + start to fix easy DScanner issues #8548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| ; Configure which static analysis checks are enabled | ||
| [analysis.config.StaticAnalysisConfig] | ||
| ; Check variable, class, struct, interface, union, and function names against | ||
| ; the Phobos style guide | ||
| style_check="disabled" | ||
| ; Check for array literals that cause unnecessary allocation | ||
| enum_array_literal_check="enabled" | ||
| ; Check for poor exception handling practices | ||
| exception_check="enabled" | ||
| ; Check for use of the deprecated 'delete' keyword | ||
| delete_check="enabled" | ||
| ; Check for use of the deprecated floating point operators | ||
| float_operator_check="enabled" | ||
| ; Check number literals for readability | ||
| number_style_check="disabled" | ||
| ; Checks that opEquals, opCmp, toHash, and toString are either const, immutable | ||
| ; , or inout. | ||
| object_const_check="enabled" | ||
| ; Checks for .. expressions where the left side is larger than the right. | ||
| backwards_range_check="enabled" | ||
| ; Checks for if statements whose 'then' block is the same as the 'else' block | ||
| if_else_same_check="enabled" | ||
| ; Checks for some problems with constructors | ||
| constructor_check="enabled" | ||
| ; Checks for unused variables and function parameters | ||
| unused_variable_check="disabled" | ||
| ; Checks for unused labels | ||
| unused_label_check="disabled" | ||
| ; Checks for duplicate attributes | ||
| duplicate_attribute="enabled" | ||
| ; Checks that opEquals and toHash are both defined or neither are defined | ||
| opequals_tohash_check="disabled" | ||
| ; Checks for subtraction from .length properties | ||
| length_subtraction_check="disabled" | ||
| ; Checks for methods or properties whose names conflict with built-in propertie | ||
| ; s | ||
| builtin_property_names_check="enabled" | ||
| ; Checks for confusing code in inline asm statements | ||
| asm_style_check="enabled" | ||
| ; Checks for confusing logical operator precedence | ||
| logical_precedence_check="disabled" | ||
| ; Checks for undocumented public declarations | ||
| undocumented_declaration_check="disabled" | ||
| ; Checks for poor placement of function attributes | ||
| function_attribute_check="enabled" | ||
| ; Checks for use of the comma operator | ||
| comma_expression_check="enabled" | ||
| ; Checks for local imports that are too broad | ||
| local_import_check="disabled" | ||
| ; Checks for variables that could be declared immutable | ||
| could_be_immutable_check="disabled" | ||
| ; Checks for redundant expressions in if statements | ||
| redundant_if_check="enabled" | ||
| ; Checks for redundant parenthesis | ||
| redundant_parens_check="disabled" | ||
| ; Checks for mismatched argument and parameter names | ||
| mismatched_args_check="disabled" | ||
| ; Checks for labels with the same name as variables | ||
| label_var_same_name_check="disabled" | ||
| ; Checks for lines longer than 120 characters | ||
| long_line_check="disabled" | ||
| ; Checks for assignment to auto-ref function parameters | ||
| auto_ref_assignment_check="disabled" | ||
| ; Checks for incorrect infinite range definitions | ||
| incorrect_infinite_range_check="enabled" | ||
| ; Checks for asserts that are always true | ||
| useless_assert_check="enabled" | ||
| ; Check for uses of the old-style alias syntax | ||
| alias_syntax_check="disabled" | ||
| ; Checks for else if that should be else static if | ||
| static_if_else_check="enabled" | ||
| ; Check for unclear lambda syntax | ||
| lambda_return_check="enabled" | ||
| ; Check for auto function without return statement | ||
| auto_function_check="enabled" | ||
| ; Check for sortedness of imports | ||
| imports_sortedness="disabled" | ||
| ; Check for explicitly annotated unittests | ||
| explicitly_annotated_unittests="disabled" | ||
| ; Check for properly documented public functions (Returns, Params) | ||
| properly_documented_public_functions="disabled" | ||
| ; Check for useless usage of the final attribute | ||
| final_attribute_check="disabled" | ||
| ; Check for virtual calls in the class constructors | ||
| vcall_in_ctor="enabled" | ||
| ; Check for useless user defined initializers | ||
| useless_initializer="disabled" | ||
| ; Check allman brace style | ||
| allman_braces_check="disabled" | ||
| ; Check for redundant attributes | ||
| redundant_attributes_check="disabled" | ||
| ; Check for public declarations without a documented unittest | ||
| has_public_example="disabled" | ||
| ; Check for asserts without an explanatory message | ||
| assert_without_msg="disabled" | ||
| ; Check indent of if constraints | ||
| if_constraints_indent="enabled" | ||
| ; Check for @trusted applied to a bigger scope than a single function | ||
| trust_too_much="enabled" | ||
| ; Check for redundant storage classes on variable declarations") | ||
| redundant_storage_classes="enabled" | ||
|
|
||
| ; Configure which modules are checked with a specific checker | ||
| ; Please help to extend these checks onto more Phobos modules | ||
| ; Process: | ||
| ; - Pick your favorite check | ||
| ; - Remove a module from the blacklist | ||
| ; - Run DScanner | ||
| ; - Fix the warnings | ||
| ; - Submit a PR to DMD | ||
| ; - GOTO: Remove a module | ||
| ; | ||
| ; Some checks are currently disabled. | ||
| [analysis.config.ModuleFilters] | ||
| redundant_storage_classes="-dmd.id,-dmd.toir,-dmd.tokens" | ||
| trust_too_much="-dmd.root.longdouble" | ||
| builtin_property_names_check="-dmd.backend.obj,-dmd.backend.code,-dmd.backend.cc" | ||
| object_const_check="-dmd.dtemplate,-dmd.backend.outbuf" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a very simplistic blacklist. For Phobos, we generated the entire blacklist for important checks.
See: dlang/phobos#5501