#content #checker #source #file #regex #required #command-line-utilties

nightly bin+lib chectarine

Content checker for source code & other text files

1 unstable release

0.1.0 Aug 14, 2023

#2485 in Development tools

GPL-3.0-only

61KB
1.5K SLoC

chectarine   Build Status Latest Version

Content checker for source code & other text files

Status: EXPERIMENTAL


$ cargo install chectarine

Example .chectarine.json5 config:

{
    {
        files: "src/**/*.rs",
        require: {
            text: "// Copyright",
            message: "A copyright notice is required on each file"
        },
    },
    {
        files: "crates/*/Cargo.toml",
        require: [
            {
                regex: "^\\s*publish\\s*=\\s*false",
                message: "Internal crates should be marked as private",
                suggestion: "Add `publish = false` to [package] section in the manifest"
            }
        ]
    },
    {
        files: [
            "src/**/.rs",
            "!src/**/*_test.rs",
        ],
        forbid: {
            text: "#[test]",
            message: "Tests should be placed in separate files"
        }
    }
}

Place it in the root directory of a project and run:

$ chectarine .

Dependencies

~8–17MB
~222K SLoC