Skip to content
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

chplcheck: allow ignoring parent/child incorrect indentation using @chplcheck.ignore #25800

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/include/chpl/framework/all-global-strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ X(swap , "<=>")
X(chplBy , "chpl_by")
X(chplAlign , "chpl_align")
X(chpldocDot , "chpldoc.")
X(chplcheckDot , "chplcheck.")
X(llvmDot , "llvm.")
X(llvmMetadata , "llvm.metadata")
X(llvmAssertVectorized, "llvm.assertVectorized")
Expand Down
1 change: 1 addition & 0 deletions frontend/lib/uast/post-parse-checks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,7 @@ void Visitor::checkAttributeNameRecognizedOrToolSpaced(const Attribute* node) {
node->name() == USTR("assertOnGpu") ||
node->name() == USTR("gpu.blockSize") ||
node->name().startsWith(USTR("chpldoc.")) ||
node->name().startsWith(USTR("chplcheck.")) ||
DanilaFe marked this conversation as resolved.
Show resolved Hide resolved
node->name().startsWith(USTR("llvm."))) {
// TODO: should we match chpldoc.nodoc or anything toolspaced with chpldoc.?
return;
Expand Down
2 changes: 1 addition & 1 deletion test/chplcheck/COMPOPTS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--using-attribute-toolname chplcheck --stop-after-pass=parseAndConvertUast
--stop-after-pass=parseAndConvertUast
34 changes: 34 additions & 0 deletions test/chplcheck/IncorrectIndentation.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,38 @@ module IncorrectIndentation {
private use super.M2;
private use super.M2;
}


@chplcheck.ignore("IncorrectIndentation")
module DirectChildrenNotIndented {
proc f1()
{
writeln("hi");
writeln("??");
}

proc f2()
{
writeln("hi");
}

@chplcheck.ignore("IncorrectIndentation")
proc f3() {
writeln("hi");
}

proc f4() {
writeln("hi");
writeln("hi");
}

proc f5() {
writeln("hi"); writeln("hi");
}

proc f6() {
for 1..10 do
writeln("hi");
}
}
}
5 changes: 5 additions & 0 deletions test/chplcheck/IncorrectIndentation.good
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,8 @@ IncorrectIndentation.chpl:305: node violates rule IncorrectIndentation
IncorrectIndentation.chpl:308: node violates rule EmptyStmts
IncorrectIndentation.chpl:314: node violates rule IncorrectIndentation
IncorrectIndentation.chpl:321: node violates rule IncorrectIndentation
IncorrectIndentation.chpl:339: node violates rule IncorrectIndentation
IncorrectIndentation.chpl:349: node violates rule IncorrectIndentation
IncorrectIndentation.chpl:353: node violates rule IncorrectIndentation
IncorrectIndentation.chpl:358: node violates rule IncorrectIndentation
[Success matching fixit for IncorrectIndentation]
Loading