Have you ever wanted to lint your open source repository for common issues at build time... such as a missing LICENSE, SECURITY.md CONTRIBUTING.md or even absent source license headers? There is a tool built by the TODO Group called repolinter that tackles this problem:
Lint open source repositories for common issues.
To run against a directory, add it to the command line
npx repolinter /my/code/dir.
To run against a git repository, use the
npx repolinter --git https://my.git.code/awesome.
Note, if you are running a version of npm < 5.2.0, run
npm install npx first.
You can also run Repo Linter locally by cloning this repository and running
bin/repolinter.js with either a directory of a git repository the same as above. This is useful during development.
To quickly get started, checkout this repository and run
npx repolinter against itself.
git clone https://github.com/todogroup/repolinter npx repolinter ✔ license-file-exists: found (LICENSE) ✔ readme-file-exists: found (README.md) ✔ contributing-file-exists: found (CONTRIBUTING) ✔ code-of-conduct-file-exists: found (CODE-OF-CONDUCT) ✔ changelog-file-exists: found (CHANGELOG) ✔ readme-references-license: File README.md contains license ✔ binaries-not-present: Excluded file type doesn't exist (**/*.exe,**/*.dll) ✔ license-detectable-by-licensee: Licensee identified the license for project: Apache License 2.0 ✔
It's as simple as running 'npx repolinter' against a repository:
You can decide what rules to run against your repository:
You can also build custom rules for your project, for example, this pull request added a rule to check for security policies (SECURITY.md):
Signed-off-by: Chris Aniszczyk firstname.lastname@example.org
If you have ideas for more rules, please contribute them to the project.
Anyways, happy open source linting!