An Interest In:
Web News this Week
- May 1, 2024
- April 30, 2024
- April 29, 2024
- April 28, 2024
- April 27, 2024
- April 26, 2024
- April 25, 2024
Linting your Open Source Repository
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:
todogroup / repolinter
Open Source Repository Linter
Lint open source repositories for common issues.
Usage
To run against a directory, add it to the command line npx repolinter /my/code/dir
.
To run against a git repository, use the --git
option: 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.
Examples
To quickly get started, checkout this repository and run npx repolinter
against itself.
git clone https://github.com/todogroup/repolinternpx 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):
Add check for security policies #146
https://help.github.com/en/articles/adding-a-security-policy-to-your-repository
Signed-off-by: Chris Aniszczyk [email protected]
If you have ideas for more rules, please contribute them to the project.
Anyways, happy open source linting!
Original Link: https://dev.to/cra/linting-your-open-source-repository-1bpn
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To