@hollowverse/validate-filenames
CLI for validating filenames in a directory according to customizable rules
Last updated 2 years ago by npmhollowverse .
Unlicense · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @hollowverse/validate-filenames 
SYNC missed versions from official npm registry.

@hollowverse/validate-filenames Build Status

You can use this package to validate that the filenames in your git repository meet your validation rules.

Current validation rules are camelCase, PascalCase, and ignore.

Installation

yarn add @hollowverse/validate-filenames

Add as an npm script

In your package.json

{
  "scripts": {
    "validate-filenames": "validate-filenames"
  }
}

Usage

In a git-managed repo run:

yarn validate-filenames

When you do that, the tool will retrieve a list of all the filenames under git control and will validate them based on the rules that you have in your config file.

Config file

You can configure validate-filenames by dropping a file called validateFilenames.json or validateFilenames.js at the root of your repo.

validate-filenames can be configured as follows

{
  "rules": [
    {
      "validation": "camelCase",
      "patterns": ["**/*"]
    },
    {
      "validation": "ignore",
      "patterns": [
        "README.md",
        "Dockerfile",
        "LICENSE.md",
        "customTypings/*",
        "typings/*"
      ]
    }
  ]
}

If you're using the js version of the configurations, you need to export an object such as the above.

Notice that rules is an array. Each item in the array is an object with two properties: validation and patterns.

validation

validation can be one of three values: camelCase, PascalCase, or ignore.

patterns

patterns is an array of glob patterns that tells validate-filenames that the validation rule applies to files that fall within this glob pattern.

Rule order

The order of the rules matter. The last rule wins. This allows us to have general rules and override those general rules with specific rules for specific paths. In the example above, we're saying all filenames within our repo should be camelCased except for certain files which should be ignored.

For issues or questions

A lot of the above may very well not make much sense. So feel free to post issues or questions here:

https://github.com/hollowverse/hollowverse/issues

Current Tags

  • 3.0.2                                ...           latest (2 years ago)

18 Versions

  • 3.0.2                                ...           2 years ago
  • 3.0.1                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.9                                ...           2 years ago
  • 1.3.8                                ...           2 years ago
  • 1.3.7                                ...           2 years ago
  • 1.3.6                                ...           2 years ago
  • 1.3.5                                ...           2 years ago
  • 1.3.4                                ...           2 years ago
  • 1.3.3                                ...           3 years ago
  • 1.3.2                                ...           3 years ago
  • 1.3.1                                ...           3 years ago
  • 1.3.0                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Downloads
Today 0
This Week 18
This Month 18
Last Day 0
Last Week 0
Last Month 0
Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |