Categorygithub.com/Consoneo/linters
modulepackage
0.0.5
Repository: https://github.com/consoneo/linters.git
Documentation: pkg.go.dev

# README

Linters

The same linting rules for all your teams!

Installation

No dependency required.

curl -s https://raw.githubusercontent.com/BlusparkTeam/linters/main/scripts/download.sh|bash
chmod +x linters

Or download the correct binary for your platform in the release page.

Some linters use Docker to run, so you need to have Docker installed on your machine.

Getting started

Generate a .linters.yaml the configuration file:

linters init

Edit the .linter.yaml file to fit your needs.

For example:

lints:
  php:
    version: "8.1"
    src:
      - src1
      - my_another_directory
    rules:
      - no-syntax-error
      - no-dump
      - no-exit
      - psr12

Then lint your files:

linters lint

Auto-fix

Some linters can fix the code for you:

linters fix

Integration with git

You can initialize a pre-commit (by default) hook with:

linters install

You can specify hooks to create with options --pre-commit, --pre-push

Rules

Get the list of rules with:

linters rules

Today, the following linters are available:

NameDescription
no-dumpCheck for var_dump in code
no-syntax-errorCheck for syntax errors in PHP files
no-exitCheck for exit() in code
psr12Check for PSR12 compliance
psr1Check for PSR1 compliance
psr2Check for PSR2 compliance
symfonyCheck for PHPCS @Symfony rules compliance
phpstanRun PHPStan analysis
phpcsRun PHP CS Fixer
eslintRun ESLint
ast-metricsRuns AstMetrics static analysis

License

Linters is open-source software licensed under the MIT license

Sponsors

Consoneo logo

The digital SaaS platform for financing and managing energy renovation aid

# Packages

No description provided by the author