# Flint [![Build Status](https://travis-ci.org/bloom42/flint.svg?branch=master)](https://travis-ci.org/bloom42/flint) [![GitHub release](https://img.shields.io/github/release/bloom42/flint.svg)](https://github.com/bloom42/flint/releases) [![flint crate](https://img.shields.io/crates/v/flint.svg)](https://crates.io/crates/flint) [![flint documentation](https://docs.rs/flint/badge.svg)](https://docs.rs/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. 1. [Installation](#installation) 2. [Docker image](#docker-image) 3. [Usage](#usage) 4. [Default conventions](#default-conventions) 5. [Contributing](#contributing) 6. [License](#license) ------------------- ## Installation ### Using Rust ```sh $ cargo install flint ``` ## Docker image [quay.io/bloom42/flint](https://quay.io/bloom42/flint) ```sh $ 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](https://opensource.bloom.sh/sane)) file at the root of your project (repo). When ran, flint will recursively search upward for a configuraiton file, starting in the current directory. ```bash $ cat .flint.sane ``` ```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](https://opensource.bloom.sh/contributing) for guidance. ## License See `LICENSE.txt` and [https://opensource.bloom.sh/licensing](https://opensource.bloom.sh/licensing)