Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
dalance committed Oct 29, 2019
1 parent b982fa7 commit 783f22e
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ readme = "README.md"
description = "SystemVerilog linter"
edition = "2018"

[package.metadata.release]
dev-version-ext = "pre"
pre-release-commit-message = "Prepare to v{{version}}"
pro-release-commit-message = "Start next development iteration v{{version}}"
tag-message = "Bump version to {{version}}"
tag-prefix = ""

[dependencies]
colored = "1.6"
failure = "0.1"
Expand Down
95 changes: 94 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,98 @@
SystemVerilog linter

[![Actions Status](https://github.com/dalance/svlint/workflows/Regression/badge.svg)](https://github.com/dalance/svlint/actions)
[![codecov](https://codecov.io/gh/dalance/svlint/branch/master/graph/badge.svg)](https://codecov.io/gh/dalance/svlint)
[![Crates.io](https://img.shields.io/crates/v/svlint.svg)](https://crates.io/crates/svlint)
[![codecov](https://codecov.io/gh/dalance/svlint/branch/master/graph/badge.svg)](https://codecov.io/gh/dalance/svlint)

## Installation

### Download binary

Download from [release page](https://github.com/dalance/svlint/releases/latest), and extract to the directory in PATH.

### Cargo

You can install by [cargo](https://crates.io/crates/procs).

```
cargo install procs
```

## Usage

### Option

```
svlint 0.1.0
USAGE:
svlint [FLAGS] [OPTIONS] <files>...
FLAGS:
--example Prints config example
-h, --help Prints help information
-s, --silent Suppresses message
-1 Prints results by single line
-V, --version Prints version information
-v, --verbose Prints verbose message
OPTIONS:
-c, --config <config> Config file [default: .svlint.toml]
-d, --define <defines>... Define
-f, --filelist <filelist> File list
-i, --include <includes>... Include path
ARGS:
<files>... Source file
```

### Rules

| Name | Description |
| ------------------------- | ----------------------------------------------------------- |
| enum_with_type | enum must have data type |
| for_with_begin | multiline 'for' statement must have 'begin' |
| function_with_automatic | 'function' must be 'automatic' |
| generate_for_with_label | 'generate for' must have label |
| generate_if_with_label | 'generate if' must have label |
| generate_keyword | 'generate'/'endgenerate' must be omitted |
| genvar_declaration | genvar must be declared in loop |
| if_with_begin | multiline 'if' statement must have 'begin' |
| inout_with_tri | 'inout' must have 'tri' |
| input_with_var | 'input' must have 'var' |
| legacy_always | 'always_comb'/'always_ff'/'always_latch' must be used |
| loop_variable_declaration | loop variable must be declared in loop |
| output_with_var | 'output' must have 'var' |
| parameter_in_package | 'parameter' must be replaced to 'localparam' in package |
| priority_keyword | 'priority' is forbidden |
| tab_charactor | tab charactor is forbidden |
| unique0_keyword | 'unique0' is forbidden |
| unique_keyword | 'unique' is forbidden |
| wire_reg | 'wire'/'reg' must be replaced to 'logic'/'tri' |

### Configuration

Configuration file is searched to the upper directory until `/`.
So you can put configuration file (`.svlint.toml`) on the repository root like `.gitignore`.

The example of configuration file is below:

```toml
[option]
exclude_paths = ["ip/.*"]

[rules]
inout_with_tri = false
input_with_var = false
output_with_var = false
```

The complete example can be generated by `svlint --example`

#### `[option]` section

`exclude_paths` is a list of regular expression. If a file path is matched with the list, the file is skipped to check.

#### `[rules]` section

By default, all rules are enabled. If you want to disable some rules, `false` can be specified.
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ pub fn run_opt(opt: &Opt) -> Result<bool, Error> {
Ok(all_pass)
}

#[cfg_attr(tarpaulin, skip)]
fn print_parse_error(printer: &mut Printer, error: sv_parser::Error) -> Result<(), Error> {
match error.kind() {
ErrorKind::Parse(Some((path, pos))) => {
Expand Down

0 comments on commit 783f22e

Please sign in to comment.