You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[derive(Args)]#[clap(flatten)]structLintArgs{/// Mark these lints as allowed#[clap(short='A', long, value_delimiter = ',', num_args = 1..)]
allow,Vec<String>,/// Emit an error on these lints but exit successfully#[clap(short='w', long, value_delimiter = ',', num_args = 1..)]
warn,Vec<String>,/// Fail linting if these occur. `-D warnings` can be passed to deny/// everything that is usually a warning#[clap(short='D', long, value_delimiter = ',', num_args = 1..)]
deny,Vec<String>,}enumLintLevel{Allow,Warn,Deny}fn x(cli:&mutArgs){letmut lints:BTreeMap<Lint,LintLevel> = generate_default_lints();ifletSome(idx) = cli.deny.iter().position(|x| *x == "warnings"){
cli.deny.remove(idx);// set all warnings to deny}for lint in cli.allow{// set lint to allow}for lint in cli.warn{// set lint to warn}for lint in cli.deny{// set lint to deny}}
More general CLI thoughts:
# Validate a single schlib file
foo validate File.SchLib
# Validate a
foo validate --schlib randomfile --pchlib otherfile
# List all items in a file
foo list File.SchLib
The text was updated successfully, but these errors were encountered:
Want to add a simple CLI interface that can do things like linting of libraries. Lint ideas:
More general CLI thoughts:
The text was updated successfully, but these errors were encountered: