1.0.1 • Published 26 days ago

dznlint v1.0.1

Weekly downloads
-
License
-
Repository
github
Last release
26 days ago

CI

dznlint

A linter helping you write correct and consistent Dezyne code.

Requires Node.js to run.

Installation

$ npm install -D dznlint

Usage

npx dznlint <options> [...files]

For help on the different options, see:

npx dznlint --help

Configuration

By default, dznlint will look for the file dznlint.config.json in its working directory. You can also specify which config file to use by providing the --config-file CLI argument. This json file should contain a subset of the available configuration values.

For example:

{
    "implicit_illegal": "warning", // Do not allow explicit illegals
    "naming_convention": {
        "component": "[A-Z][a-zA-Z0-9]*", // Set naming convention for component
        "interface": "I[A-Z][a-zA-Z0-9]*" // Set naming convention for interface
    },
    "no_shadowing": "warning" // Set shadowing rule violations to 'warning' severity
}

Available rules:

Default values are indicated in bold.

call_arguments_must_match

Arguments passed to a function call must match the parameters of that function or event.

Possible values: "hint" | "warning" | "error"


dead_code

No code allowed after return statements in functions.

Possible values: "hint" | "warning" | "error"


implicit_illegal

Do not mark events explicitly illegal. As of Dezyne 2.14, events not mentioned are implicitly assumed to be illegal.

Possible values: "hint" | "warning" | "error"


inline_temporary_variables

Temporary variables that are only referred to once should be inlined.

Possible values: "hint" | "warning" | "error"


naming_convention

Naming convention for various different variables.

Default value:

{
    "component": "[A-Z][a-zA-Z0-9]*",
    "enum": "[A-Z][a-zA-Z0-9]*",
    "enum_member": "[A-Z][a-zA-Z0-9]*",
    "interface": "I[A-Z][a-zA-Z0-9]*",
    "local": "[a-z_][a-zA-Z0-9]*",
    "type": "[A-Z][a-zA-Z0-9]*"
}

never_fired_event

If an out event in an interface is never fired it is not useful, and often indicates the programmer forgot something.

Possible values: "hint" | "warning" | "error"


never_legal_event

If an in event in an interface is always illegal it is not useful, and often indicates the programmer forgot something.

Possible values: "hint" | "warning" | "error"


no_bool_out_parameters

Out parameters of type bool are not allowed by Dezyne and will lead to a well-formedness error.

Possible values: "hint" | "warning" | "error"


no_duplicate_parameters

Parameters should have distinct names.

Possible values: "hint" | "warning" | "error"


no_duplicate_port_binding

Ports cannot be bound more than once.

Possible values: "hint" | "warning" | "error"


no_empty_defer_capture

Defer statements should capture one or more state variables to prevent unexpected verification time explosion due to the defer queue unexpectedly growing.

Possible values: "hint" | "warning" | "error"


no_recursive_system

Systems cannot contain instances of themself.

Possible values: "hint" | "warning" | "error"


no_shadowing

Parameters and variables should not shadow (re-define) variables that already exist in scope.

Possible values: "hint" | "warning" | "error"


no_unconnected_ports

All ports in a system should be connected for the system to be valid.

Possible values: "hint" | "warning" | "error"


no_unknown_imports

Imported dzn files should be resolvable by dznlint. This check might fail if the include directories are not properly set. If this check fails other linting rules might also fail, since they rely on type information.

Possible values: "hint" | "warning" | "error"


no_unknown_variables

All referenced variables, members and types should be known.

Possible values: "hint" | "warning" | "error"


no_unknown_port_binding

Bindings cannot bind to unknown ports.

Possible values: "hint" | "warning" | "error"


no_unused_instances

Defined instances should be used in at least one binding.

Possible values: "hint" | "warning" | "error"


no_unused_parameters

Parameters should be referenced at least once, or escaped by prefixing (or replacing with) _.

Possible values: "hint" | "warning"| "error"


no_unused_variables

Defined variables should be referenced at least once.

Possible values: "hint" | "warning" | "error"


on_parameters_must_match

Parameters in an on trigger must match the number of parameters specified by the triggering event.

Possible values: "hint" | "warning" | "error"


parameter_direction

Parameter direction (in/out/inout) should always be specified.

Possible values: "hint" | "warning" | "error"

port_missing_redundant_blocking

As of Dezyne 2.15, a provided port should be marked blocking if any of its calls is implemented using the blocking keyword. On the other hand, if no blocking is used in the behavior for this port, it should not be marked as blocking.

Possible values: "hint" | "warning" | "error" (Default: disabled for backwards compatibility)

1.0.1

26 days ago

1.0.0

4 months ago

0.0.28-alpha.13

4 months ago

0.0.28-alpha.15

4 months ago

0.0.28-alpha.14

4 months ago

0.0.28-alpha.12

4 months ago

0.0.28-alpha.11

4 months ago

0.0.28-alpha.10

4 months ago

0.0.28-alpha.9

4 months ago

0.0.28-alpha.8

4 months ago

0.0.28-alpha.7

4 months ago

0.0.28-alpha.6

4 months ago

0.0.28-alpha.5

4 months ago

0.0.28-alpha.4

4 months ago

0.0.28-alpha.3

4 months ago

0.0.28-alpha.2

4 months ago

0.0.28-alpha.1

4 months ago

0.0.28-alpha.0

4 months ago

0.0.26

6 months ago

0.0.27

6 months ago

0.0.25

8 months ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.22

1 year ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago