{"id":24756327,"url":"https://github.com/dalance/flexlint","last_synced_at":"2025-04-09T08:10:20.958Z","repository":{"id":33172589,"uuid":"153603137","full_name":"dalance/flexlint","owner":"dalance","description":"A flexible linter with rules defined by regular expression","archived":false,"fork":false,"pushed_at":"2025-03-10T20:41:25.000Z","size":471,"stargazers_count":29,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T06:07:25.565Z","etag":null,"topics":["command-line-tool","lint","linter","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dalance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"dalance"}},"created_at":"2018-10-18T10:02:07.000Z","updated_at":"2025-03-10T20:41:23.000Z","dependencies_parsed_at":"2024-01-08T21:54:26.137Z","dependency_job_id":"7072e7cc-de5e-44bd-87d0-93388a6c3aad","html_url":"https://github.com/dalance/flexlint","commit_stats":{"total_commits":176,"total_committers":3,"mean_commits":"58.666666666666664","dds":0.5681818181818181,"last_synced_commit":"2c39c1f52179a6aca728bb8a8082ddc26fecda33"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fflexlint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fflexlint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fflexlint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fflexlint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dalance","download_url":"https://codeload.github.com/dalance/flexlint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999861,"owners_count":21031046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","lint","linter","rust"],"created_at":"2025-01-28T13:50:51.054Z","updated_at":"2025-04-09T08:10:20.937Z","avatar_url":"https://github.com/dalance.png","language":"Rust","funding_links":["https://github.com/sponsors/dalance"],"categories":[],"sub_categories":[],"readme":"# flexlint\n\n**flexlint** is a flexible linter with rules defined by regular expression.\n\n[![Actions Status](https://github.com/dalance/flexlint/workflows/Regression/badge.svg)](https://github.com/dalance/flexlint/actions)\n[![Crates.io](https://img.shields.io/crates/v/flexlint.svg)](https://crates.io/crates/flexlint)\n\n## Install\nDownload from [release page](https://github.com/dalance/flexlint/releases/latest), and extract to the directory in PATH.\n\nAlternatively you can install by [cargo](https://crates.io).\n\n```\ncargo install flexlint\n```\n\n## Usage\n\n### Option\n\n```\nflexlint 0.1.0\ndalance \u003cdalance@gmail.com\u003e\nA flexible linter with rules specified by regular expression\n\nUSAGE:\n    flexlint [FLAGS] [OPTIONS]\n\nFLAGS:\n    -h, --help       Prints help information\n    -s, --simple     Show results by simple format\n    -V, --version    Prints version information\n    -v, --verbose    Show verbose message\n\nOPTIONS:\n    -r, --rule \u003crule\u003e    Rule file [default: .flexlint.toml]\n```\n\nRule file is searched to the upper directory until `/`.\nSo you can put rule file (`.flexlint.toml`) on the repository root like `.gitignore`.\n\n### Rule definition\n\nRule definition is below:\n\n```toml\n[[rules]]\nname      =  \"\"   # name of rule\npattern   =  \"\"   # check pattern by regexp\nrequired  =  \"\"   # required pattern by regexp [Optional]\nforbidden =  \"\"   # forbidden pattern by regexp [Optional]\nignore    =  \"\"   # ignore pattern by regexp [Optional]\nhint      =  \"\"   # hint message\nincludes  =  [\"\"] # include file globs\nexcludes  =  [\"\"] # exclude file globs [Optional]\n```\n\nIf `pattern` is matched, `required` or `forbidden` is tried to match at the `pattern` matched point.\nSo `required` pattern is not matched, or `forbidden` pattern is matched, then check is failed.\n`required` and `forbidden` is optional, but if both of them is not defined, check is skipped.\nIf the `pattern` matched point is included in the `ignore` matched range, check is skipped.\nIf files matched `includes` match `excludes` too, the files are skipped.\n\nThe example for `if` with brace of C/C++ is below:\n\n```toml\n[[rules]]\nname      = \"'if' with brace\"\npattern   = '(?m)(^|[\\t ])if\\s'\nforbidden = '(?m)(^|[\\t ])if\\s[^;{]*$'\nignore    = '(/\\*/?([^/]|[^*]/)*\\*/)|(//.*\\n)'\nhint      = \"multiline 'if' must have brace\"\nincludes  = [\"**/*.c\", \"**/*.cpp\"]\nexcludes  = [\"external/*.c\"]\n```\n\n`pattern` is matched `if` keyword and `forbidden` check that `if` must have `;` or `{` until the end of line.\n( This example don't support some brace-style, you can modify it )\n\n`ignore` is defined to skip single line comment (`// ...`) and multi-line comment (`/* ... */`).\n\n### Regular expression\n\nThe syntax of regular expression follows [Rust regex crate](https://docs.rs/regex/latest/regex/#syntax).\n\n### The example of output\n\nIf flexlint is executed in `example` directory of the repository, the output is below:\n\n```console\n$ cd example\n$ flexlint\nFail: 'if' with brace\n   --\u003e test.c:4:4\n  |\n4 |     if ( hoge )\n  |    ^^^^ hint: multiline 'if' must have brace\n\nFail: verilog 'always' forbidden\n   --\u003e test.sv:7:4\n  |\n7 |     always @ ( posedge clk ) begin\n  |    ^^^^^^^^ hint: 'always' must be replaced to 'always_comb'/'always_ff'\n\nFail: 'if' with 'begin'\n   --\u003e test.sv:13:8\n   |\n13 |         if ( rst )\n   |        ^^^^ hint: 'if' statement must have 'begin'\n\nFail: 'else' with 'begin'\n   --\u003e test.sv:15:8\n   |\n15 |         else\n   |        ^^^^^^ hint: 'else' statement must have 'begin'\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalance%2Fflexlint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdalance%2Fflexlint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalance%2Fflexlint/lists"}