Logo

dev-resources.site

for different kinds of informations.

Introducing Japr - The Project Linter

Published at
1/21/2024
Categories
japr
linting
Author
jamoyjamie
Categories
2 categories in total
japr
open
linting
open
Author
10 person written this
jamoyjamie
open
Introducing Japr - The Project Linter

Japr is a cross-language tool for rating and enforcing the overall quality of projects by looking at tool & language setup

Over summarized: It's a linter that makes sure you install linters (and some other stuff)

GitHub | PyPi | Docker

Screenshot of a report

Japr

Japr is a linter to help you make sure your project is setup as best as it can be. It checks things like:

  • Do you have a readme? Does it have a getting started section or some installation docs?
  • Have you setup a linter for your language? Are you following the best practices for setting up those languages?
  • Is git setup correctly? Using main instead of master and excluding the right files?

Obviously project setup depends highly on the project's purpose so Japr has four configurations available:

  • Personal - A lightweight ruleset designed to tidy up personal projects
  • Team - A balanced ruleset designed for projects that belong to a single team
  • Inner Source - A comprehensive ruleset for projects that are accessible across an organisation and may be used by other teams (often referred to as 'inner source' projects
  • Open Source - A comprehensive ruleset for open source projects that are for anyone and everyone that might stumble upon the code

Japr is a very strict linter, it's opinionated and hard to satisfy so don't be upset if your project doesn't pass straight away! I don't have a single project that meets all of Japr's demands (even, ironically, Japr itself). Make use of the auto fixes and don't be afraid to suppress things if you disagree!

Rationale

Think about your favourite open source project. Chances are it's very easy to get started with because you just looked at the readme and followed the steps. Perhaps you've raised an issue and they'd setup issue templates to help you help them. Perhaps you committed some code, ran their linters and their CI/CD pipelines.

Now think about a time when the codebase hurt you, maybe that proof-of-concept code you inherited from a coworker full of .DS_Store files or that GitHub project that might have been perfect for you if you could actually build it.

A lot of the differences between those two projects probably seem like common sense. Create a readme, setup CI/CD, create a .gitignore but there's plenty more things we take for granted in the best projects.

We lint basic things like our code formatting which could also be fixed with common sense, why not lint our project setup?

Getting Started

You can install Japr using pip and run as you expect:

pip install japr
japr <path> -t <project-type>
Enter fullscreen mode Exit fullscreen mode

Or just run it in Docker:

docker run --rm -v $(pwd):/app jamoyjamie/japr:v1.0.1 -t <project-type>
Enter fullscreen mode Exit fullscreen mode

Project type should be one of personal, team, inner-source or open-source depending on what best suits your project!

There's also experimental auto fixing for some issues which you can try by adding --fix!

Animation of the tool usage

Future

I'll be using Japr on new projects and retrofitting old projects as I work on them again. I intend to add support for the other languages and tools I use as I go (e.g. terraform, helm) but I'll gladly accept advice, discussion and pull requests for other languages or general debate into the rulesets so that they represent a consensus.

Please give it a try, feedback and let me know what your highest project scores are!

linting Article's
30 articles in total
Favicon
How to Configure VSCode for Auto Formatting and Linting in Python
Favicon
Level Up Your OpenAPI Specs using Linting
Favicon
Most elemental code formatting for Typescript/Javascript: .editorconfig vs prettier
Favicon
standardrb, but more
Favicon
Introducing Japr - The Project Linter
Favicon
Level Up Your TypeScript Projects: Discover the Power of ESLint and Prettier
Favicon
Interview with Greg Molnar - Rails developer and penetration tester
Favicon
Setting WordPress Coding Standards per project using Composer
Favicon
Linting Proto Files With Buf
Favicon
ESLint: The Hows, Whys, and Who Behind It
Favicon
Puppet-lint: Soft dependency conflicts after updating
Favicon
Eslint rule to restrict imports
Favicon
Laravel Tooling: 4 tools for static analysis
Favicon
Terraform: Variable validation with samples
Favicon
An Incremental Approach to Linting to Your Projects
Favicon
Add EsLint to existing Angular Project and Configure WebStorm
Favicon
Quick ESLint guide + VsCode ESLint on save
Favicon
Chickity-check yo self before you wreck yo self!
Favicon
How to configure Eslint in Gatsby projects
Favicon
Automatically sorting your Tailwind CSS class names
Favicon
Setting up ESLint + Prettier
Favicon
Incrementally adding Stylelint rules with Betterer
Favicon
Conventional Git Commit Messages and Linting
Favicon
ยฟQuรฉ es Linting y ESLint?
Favicon
My 2020 Python linting setup: How I Learned to Stop Worrying and Love the automated code formatting
Favicon
ESLint not working in VSCode? Help build a troubleshooting checklist!
Favicon
SERIES: React Native (Step by Step) - Working with Typescript and Linting
Favicon
Adding Markdown Linting to my Blogโ€™s Build Process with GitHub Actions and markdownlint
Favicon
TIL - ๐Ÿงน unimport linter formatter
Favicon
Adding New Lint Rules Without the Fuss

Featured ones: