This PR adds problem classes in order to squelch warnings/errors.
Problem class
Each problem is classified one problem class. For example, the following problems belong to lib/version problem class.
A Satyrographos library has an empty version id.
A Satyrographos library has an invalid version id.
Each OPAM Lint error/warning is considered as problem class opam-file/lint/<opam-warning-no>. For example, an empty synopsis field causes opam-file/lint/47.
-W option
-W option is added to disable warnings/errors being reported by lint subcommand. For example,
# Disable OPAM Lint Warnings 47, 48, and 50; and library version warnings
satyrographos lint -W 'opam-file/lint/{-47..50,+49},lib/version'
For now, -W option can disable not only warning but also errors. This behavior should be revised when lint subcommand is stable enough since errors should not be turned off.
-W option takes a warning expression. The grammar is following.
main ::=
| exprs
exprs ::=
| expr ( "," expr )*
-- List of exprs
| ( atom "/" )* "{" exprs "}"
-- Common prefix for the exprs
expr ::=
| ( "+" | "-" ) glob
-- Enable or disable warnings matching the glob
glob ::=
| "*"
| atom
| atom "/" glob
| "{" globList "}"
-- Alternative choose
globList ::=
| glob
| glob "," globList
atom ::=
| id
| range
id ::=
| idCharFirst idChar
idCharFirst ::=
| alphaNum
idChar ::=
| idCharFirst
| "_" | "-" | "."
range ::=
| digit ".." digit
Examples:
+a/b enables warnings prefixed with a/b, e.g., a/b, a/b/c, but not a/bc or a.
+a/* enables warnings prefixed with a/, e.g., a/b, a/b/c, but not a/bc or a.
-*,+a disables all the warnings but ones prefixed with a.
a/{+b,-c} is equivalent to +a/b,-a/c
+a/{b,c} is equivalent to a/{+b,+c} so as to +a/b,+a/c.
This PR adds problem classes in order to squelch warnings/errors.
Problem class
Each problem is classified one problem class. For example, the following problems belong to
lib/version
problem class.Each OPAM Lint error/warning is considered as problem class
opam-file/lint/<opam-warning-no>
. For example, an emptysynopsis
field causesopam-file/lint/47
.-W
option-W
option is added to disable warnings/errors being reported bylint
subcommand. For example,For now,
-W
option can disable not only warning but also errors. This behavior should be revised when lint subcommand is stable enough since errors should not be turned off.-W
option takes a warning expression. The grammar is following.Examples:
+a/b
enables warnings prefixed witha/b
, e.g.,a/b
,a/b/c
, but nota/bc
ora
.+a/*
enables warnings prefixed witha/
, e.g.,a/b
,a/b/c
, but nota/bc
ora
.-*,+a
disables all the warnings but ones prefixed witha
.a/{+b,-c}
is equivalent to+a/b,-a/c
+a/{b,c}
is equivalent toa/{+b,+c}
so as to+a/b,+a/c
.+{1..3,a}
is equivalent to+1,+2,+3,+a
This is the command line option for https://github.com/na4zagin3/satyrographos/issues/166