[Chapel Merge] Add option to enforce unindented modules in chplcheck

Branch: refs/heads/main
Revision: 6ea7f87235f6fe2bcb9782ac26e4111c254b26fb
Author: jabraham17
Link: Add option to enforce unindented modules in chplcheck by jabraham17 · Pull Request #28705 · chapel-lang/chapel · GitHub
Log Message:
Add option to enforce unindented modules in chplcheck (#28705)

Add a new option to the IncorrectIndentation lint rule to allow for
unindented modules

module Foo {
proc foo() { }
}

This is a common pattern in Chapel code to avoid over-indenting the code

I also adjusted a few cases in the code to improve the error messages so
users see a nice error, rather than a python exception

  • start_test test/chplcheck

[Reviewed by @DanilaFe]

Compare: Comparing 1237c51e751fec4fb94c06e3d52904bc36cb7a08...f486c5fa90ed2bae7ef558ca635d111774abc00c · chapel-lang/chapel · GitHub

Diff:
A test/chplcheck/IncorrectIndentationMod.chpl
A test/chplcheck/IncorrectIndentationMod.chplcheckopts
A test/chplcheck/IncorrectIndentationMod.good
A test/chplcheck/IncorrectIndentationMod.good-fixit
M tools/chplcheck/src/chplcheck.py
M tools/chplcheck/src/config.py
M tools/chplcheck/src/indentation.py
M tools/chplcheck/src/lsp.py
M tools/chplcheck/src/rules.py
https://github.com/chapel-lang/chapel/pull/28705.diff