All Projects → jsoendermann → mouette

jsoendermann / mouette

Licence: other
🐦 [WIP] Lint your MongoDB.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to mouette

lint-prepush
Lint committed files on pre-push 🔬
Stars: ✭ 18 (+50%)
Mutual labels:  linter
pahout
A pair programming partner for writing better PHP. Pahout means PHP mahout 🐘
Stars: ✭ 43 (+258.33%)
Mutual labels:  linter
clj-kondo.lsp
Clj-kondo language server and VSCode extension: https://marketplace.visualstudio.com/items?itemName=borkdude.clj-kondo
Stars: ✭ 17 (+41.67%)
Mutual labels:  linter
fsharp-linting-for-vs
Visual Studio Linter for F#
Stars: ✭ 33 (+175%)
Mutual labels:  linter
cpplint
Static code checker for C++
Stars: ✭ 1,014 (+8350%)
Mutual labels:  linter
ue5-style-guide
An attempt to make Unreal Engine 4 projects more consistent
Stars: ✭ 2,892 (+24000%)
Mutual labels:  linter
dockerfile-utils
A library and command line interface for formatting and linting Dockerfiles.
Stars: ✭ 17 (+41.67%)
Mutual labels:  linter
addlint
An example linter written with go/analysis for tutorial purposes
Stars: ✭ 49 (+308.33%)
Mutual labels:  linter
static-code-analysis-plugin
A plugin to simplify Static Code Analysis on Gradle. Not restricted to, but specially useful, in Android projects, by making sure all analysis can access the SDK classes.
Stars: ✭ 36 (+200%)
Mutual labels:  linter
megalinter
🦙 Mega-Linter analyzes 48 languages, 22 formats, 19 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
Stars: ✭ 534 (+4350%)
Mutual labels:  linter
codeclimate-eslint
Code Climate Engine for ESLint
Stars: ✭ 86 (+616.67%)
Mutual labels:  linter
salt-lint
A command-line utility that checks for best practices in SaltStack.
Stars: ✭ 111 (+825%)
Mutual labels:  linter
quick-lint-js
quick-lint-js finds bugs in JavaScript programs
Stars: ✭ 575 (+4691.67%)
Mutual labels:  linter
scalafix-maven-plugin
Enables automatic refactoring and linting of Maven projects written in Scala using Scalafix.
Stars: ✭ 15 (+25%)
Mutual labels:  linter
dustmite
A linter for DustJS templates
Stars: ✭ 14 (+16.67%)
Mutual labels:  linter
go-namecheck
Source code analyzer that helps you to maintain variable/field naming conventions inside your project.
Stars: ✭ 37 (+208.33%)
Mutual labels:  linter
godot
Linter that checks if comments end in a period
Stars: ✭ 28 (+133.33%)
Mutual labels:  linter
durationcheck
Go linter to detect erroneous multiplication of duration values
Stars: ✭ 28 (+133.33%)
Mutual labels:  linter
illuaminate
Very WIP static analysis for Lua
Stars: ✭ 21 (+75%)
Mutual labels:  linter
golintui
A simple terminal UI for Go linters
Stars: ✭ 73 (+508.33%)
Mutual labels:  linter

Mouette

Mouette is a linter for your MongoDB.

Try it

yarn global add mouette
mouette lint -s summary mongodb://...
mouette lint mongodb://...

To learn more about what mouette can do, run mouette --help

Rules

  • Collection names camel/snake case: Make sure all collection names in the database have the right case.
    • case: The case your collection names should be in.
  • Collection names singular/plural: Make sure all collections in the database have names that are either singular or plural.
    • number: The grammatical number that collection names should be checked for.
  • Key names singular/plural: Make sure all keys in the database have the right case.
    • case: The case your keys should be in.
  • Keys that end in At should refer to dates: Make sure columns with keys that end in ...At contain nothing but dates.
    • allow-stringified-days: Whether to allow dates that are saved as strings.
    • stringified-days-regex: The regexp used to determine whether a string contains a date.
  • Max key count: Enforces a maximum number of keys per collection.
    • maximum-excluding-_id: The maximum number of keys allowed.
  • No bad key names: Make sure no common bad key names are used.
    • names-considered-bad: Key names that should be avoided.
  • No dates saved as string: Makes sure dates don't get saved as strings.
  • No leading underscores in key names: Make sure no key name except _id starts with an underscore.
  • No mixed types: Makes sure columns contain values of no more than one type.
  • No null: Make sure columns do not contain null values.
  • No numbers saved as string: Makes sure numbers don't get saved as strings.
    • strict-number-check: When this is set to true, strings like '015', '0xF' or '0b1111 are not considered to be numbers.
  • No undefined: Make sure columns do not contain undefined values.
  • Question keys should refer to booleans: Make sure columns with keys that start with verbs like "is" or "has" contain nothing but booleans.
    • boolean-key-prefixes: Which prefixes should indicate booleans.

Features

  • Completely schemaless, mouette needs no information about your db to run
  • Suggests fixes where possible
  • Prints queries ready to be pasted into the MongoDB shell that print all the documents that need fixing
  • Includes a diffing function that can be used to find all rule violations that were added since your last lint
  • Can be run as a binary or included as a library

Develop

git clone https://github.com/jsoendermann/mouette/
cd mouette
yarn
npm run watch
node dist/bin/mouette.js lint <your mongodb://...>

Add a new rule

  1. Copy src/rules/_RULE_TEMPLATE.ts to a new file in src/rules/.
  2. Follow the instructions in that file to implement your rule.
  3. Add default options for your new rule to defaultConfig.toml.
  4. Write tests and add them to __tests__/rules.test.ts.
  5. Send me a pull request and share your new rule with the world.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].