Skip to content

Commit

Permalink
Rename the "RedundantParentheses" rule to "ControlFlowParentheses"
Browse files Browse the repository at this point in the history
Signed-off-by: Danila Fedorin <[email protected]>
  • Loading branch information
DanilaFe committed Jun 29, 2024
1 parent 59f3115 commit 7a3c887
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ lint-standard-modules: chplcheck FORCE
tools/chplcheck/chplcheck --skip-unstable \
--internal-prefix "_" \
--internal-prefix "chpl_" \
--disable-rule "RedundantParentheses" \
--disable-rule "ControlFlowParentheses" \
$(MODULES_TO_LINT)

compile-util-python: FORCE
Expand Down
File renamed without changes.
34 changes: 34 additions & 0 deletions test/chplcheck/ControlFlowParentheses.good
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ControlFlowParentheses.chpl:1: node violates rule UseExplicitModules
ControlFlowParentheses.chpl:13: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:14: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:15: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:16: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:17: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:18: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:19: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:20: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:21: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:23: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:24: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:25: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:26: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:27: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:28: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:29: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:30: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:31: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:33: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:34: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:35: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:36: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:37: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:38: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:39: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:40: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:41: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:43: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:45: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:47: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:49: node violates rule ControlFlowParentheses
ControlFlowParentheses.chpl:51: node violates rule ControlFlowParentheses
[Success matching fixit for ControlFlowParentheses]
34 changes: 0 additions & 34 deletions test/chplcheck/RedundantParentheses.good

This file was deleted.

2 changes: 1 addition & 1 deletion test/chplcheck/activerules.good
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Active rules:
CamelCaseRecords Warn for records that are not 'camelCase'.
ChplPrefixReserved Warn for user-defined names that start with the 'chpl_' reserved prefix.
ComplexLiteralOrder Warn for complex literals that are not in a consistent order.
ControlFlowParentheses Warn for unnecessary parentheses in conditional statements and loops.
DoKeywordAndBlock Warn for redundant 'do' keyword before a curly brace '{'.
EmptyStmts Warn for empty statements (i.e., unnecessary semicolons).
IncorrectIndentation Warn for inconsistent or missing indentation
MethodsAfterFields Warn for classes or records that mix field and method definitions.
MisleadingIndentation Warn for single-statement blocks that look like they might be multi-statement blocks.
PascalCaseClasses Warn for classes that are not 'PascalCase'.
PascalCaseModules Warn for modules that are not 'PascalCase'.
RedundantParentheses Warn for unnecessary parentheses in conditional statements and loops.
SimpleDomainAsRange Warn for simple domains in loops that can be ranges.
UnusedLoopIndex Warn for unused index variables in loops.
UnusedTupleUnpack Warn for unused tuple unpacking, such as '(_, _)'.
2 changes: 1 addition & 1 deletion test/chplcheck/allrules.good
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Available rules (default rules marked with *):
* ChplPrefixReserved Warn for user-defined names that start with the 'chpl_' reserved prefix.
* ComplexLiteralOrder Warn for complex literals that are not in a consistent order.
ConsecutiveDecls Warn for consecutive variable declarations that can be combined.
* ControlFlowParentheses Warn for unnecessary parentheses in conditional statements and loops.
* DoKeywordAndBlock Warn for redundant 'do' keyword before a curly brace '{'.
* EmptyStmts Warn for empty statements (i.e., unnecessary semicolons).
* IncorrectIndentation Warn for inconsistent or missing indentation
Expand All @@ -15,7 +16,6 @@ Available rules (default rules marked with *):
NestedCoforalls Warn for nested 'coforall' loops, which could lead to performance hits.
* PascalCaseClasses Warn for classes that are not 'PascalCase'.
* PascalCaseModules Warn for modules that are not 'PascalCase'.
* RedundantParentheses Warn for unnecessary parentheses in conditional statements and loops.
* SimpleDomainAsRange Warn for simple domains in loops that can be ranges.
UnusedFormal Warn for unused formals in functions.
* UnusedLoopIndex Warn for unused index variables in loops.
Expand Down
2 changes: 1 addition & 1 deletion tools/chplcheck/src/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def DoKeywordAndBlock(
return check

@driver.basic_rule(set((Loop, Conditional)))
def RedundantParentheses(
def ControlFlowParentheses(
context: Context, node: typing.Union[Loop, Conditional]
):
"""
Expand Down

0 comments on commit 7a3c887

Please sign in to comment.