npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dznlint

v1.0.1

Published

A linter for Dezyne .dzn files. Providing extra warnings and coding style analysis.

Downloads

93

Readme

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)