Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
February 13, 2020 01:00 am GMT

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:

GitHub logo todogroup / repolinter

Open Source Repository Linter

Repo Linter Build Status

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:

repolinter output

You can decide what rules to run against your repository:

repolinter rules

You can also build custom rules for your project, for example, this pull request added a rule to check for security policies (SECURITY.md):

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

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To