Skip to content

Commit 66e29b9

Browse files
committed
Introduce the USAGE.md file
Signed-off-by: Jonatan Waern <[email protected]>
1 parent 4c2612b commit 66e29b9

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# Change Log
66

77
## 0.9.13
8+
- You can now annotate dml source to disable reporting of specific lints for specific files or lines,
9+
see [USAGE.md](USAGE.md) for instructions on how to use it
810

911
## 0.9.12
1012
- Added 'simics\_util\_vect' as a known provisional (with no DLS semantics)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ editors, and other tools with information about DML device and common code.
99
It currently supports basic syntax error reporting, symbol search,
1010
'goto-definition', 'goto-implementation', 'goto-reference', and 'goto-base'.
1111
It also has some basic configurable linting support, in the form of warning
12-
messages.
12+
messages. For user-targeted instructions, see [USAGE.md](USAGE.md).
1313

1414
Future planned features are extended semantic and type analysis, basic
1515
refactoring patterns, improved language construct templates, renaming

USAGE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!--
2+
© 2024 Intel Corporation
3+
SPDX-License-Identifier: Apache-2.0 and MIT
4+
-->
5+
# Usage Instructions
6+
This document describes general instructions and advice directed at
7+
end-users of the DML language server. For advice or details on
8+
client implementation see [clients.md](clients.md). This document
9+
_only_ pertains to details that are client-agnostic. For client-specific
10+
details consult the documentation of the client.
11+
12+
As this file is currently a work in progress, relevant details may be
13+
missing or incomplete.
14+
15+
## In-Line Linting Configuration
16+
It may be desireable to control linting on a per-file basis, rather than
17+
relying on the linting configuration. This can be done with in-line
18+
linting configuration inside comments.
19+
20+
The general syntax is:
21+
`// dls-lint: <command>=<target>`
22+
Note that only one-line comments are allowed, and only if no text is between
23+
the comment start and 'dls-lint'.
24+
25+
Currently supported commands are:
26+
* 'allow-file' Will not report the lint rule specified by \<target> for the
27+
entire file, regardless of where 'allow-file' is declared
28+
* 'allow' Will not report the lint rule specified by <target> for the next
29+
line without a leading comment, or for the current line if declared
30+
outside a leading comment.
31+
32+
Lint warnings will report which rule caused them in their message, which is the
33+
same identifier used for \<target>.
34+
35+
For example
36+
```
37+
// dls-lint: allow-file=long_lines
38+
method now_we_can_declare_this_method_with_a_really_really_really_really_long name() {
39+
40+
// dls-lint: allow=nsp_unary
41+
// dls-lint: allow=indent_no_tabs
42+
param p = (1 ++ *
43+
4); // dls-lint: allow=indent_paren_expr
44+
}
45+
```
46+
Will allow 'long_lines' globally, 'nsp_unary' and 'indent_no_tabs' on the
47+
`param p = (1 ++ *` line, and 'indent_paren_expr' on the `'4);` line.

0 commit comments

Comments
 (0)