5 releases (3 stable)
2.2.0 | Apr 21, 2019 |
---|---|
2.1.0 | Apr 8, 2019 |
2.0.0 | Apr 1, 2019 |
0.1.1 | Mar 27, 2019 |
0.1.0 | Mar 27, 2019 |
#954 in Filesystem
195KB
1.5K
SLoC
Flint
You think there is no place in code reviews to discuss about files naming conventions ? Enforce consistent files and directories naming rules with flint: the filesystem linter.
Installation
Using Rust
$ cargo install flint
Docker image
$ docker run -v `pwd`:/flint quay.io/bloom42/flint:latest
Usage
Configuration is stored in a .flint.sane
(see here for more info about the SANE configuration format)
file at the root of your project (repo).
When ran, flint will recursively search upward for a configuraiton file, starting in the current directory.
$ cat .flint.sane
rules = [
{
pattern = "*.rs", # optional, default to "*"
convention = "snake_case", # mandatory, one the default conventions below or a Rust regex https://docs.rs/regex/1.1.4/regex/
},
{
pattern = "*.go",
convention = "^[a-z][a-z_\\d]*[a-z\\d]$",
},
]
Default conventions
Name | Description |
---|---|
any |
Allow any filename .* |
snake_case |
Force names to respect the snake_case convention ^[a-z][a-z_\d]*[a-z\d]$ |
kebab_case |
Force names to respect the kebab-case convention ^[a-z][a-z\-\d]*[a-z\d]$ |
upper_snake_case |
Force names to respect the UPPER_SNAKE_CASE convention ^[A-Z][A-Z_\d]*$ |
camel_case |
Force names to respect the camelCase convention ^[a-z][A-Za-z\d]*$ |
pascal_case |
Force names to respect the PascalCase convention ^[A-Z][A-Za-z\d]*$ |
Contributing
Thank you for your interest in contributing! Please refer to https://opensource.bloom.sh/contributing for guidance.
License
See LICENSE.txt
and https://opensource.bloom.sh/licensing
Dependencies
~5–15MB
~156K SLoC