-
Notifications
You must be signed in to change notification settings - Fork 424
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
Auto-generate documentation for chplcheck lint rules #26208
Conversation
2de10a6
to
3cc699f
Compare
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
f7aeeba
to
d9a845a
Compare
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
tools/chplcheck/examples/PREDIFF
Outdated
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 looks like a copy of the PREDIFF elsewhere; can you symlink it instead?
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.
It is a copy. But tools/chplcheck/examples
is included in the tarball while test/chplcheck/PREDIFF
is not, so the tarball will have broken symlinks
with context.track_errors() as _: | ||
for loc, node, rule, fixits in driver.run_checks(context, asts): | ||
diagnostic = Diagnostic( | ||
range=chapel.lsp.location_to_range(loc), | ||
message="Lint: rule [{}] violated".format(rule), | ||
severity=DiagnosticSeverity.Warning, | ||
code=rule, | ||
code_description=CodeDescription(base_url + "#" + rule.lower()), |
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.
nice touch!
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Adds documentation for
chplcheck
rules, auto-generated from the existingchplcheck
rule defintions.This PR makes the following changes:
make docs
will now build arules.rst
file which is included in thechplcheck
documentation which lists all lint rulesdoc/util/chplcheck-docs.py
, which is also available to users for their own custom rule filestools/chplcheck/examples
. These are included in the online docs and provide reasoning to users about why a lint rule existschplcheck
langauge server will provides a link straight to rule documentationFuture work:
tools/chplcheck/examples
[Reviewed by @DanilaFe]