Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@officient/readable

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@officient/readable

PHP code linter

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

readable

PHP code analyzer, similar to eslint, but with a focus on readability. The idea is to build an analyzer that can guarantee long term code maintainability for a project. The main project values are extendibility, ease of use, speed of analysis and simplicity.

quick links: Rules and default configuration

codecov

Codeship Status for officient/readable

Installation and Usage

You can install readable using npm:

$ npm install @officient/readable --save-dev

You can get the help on useage:

$ npx readable --help

You should then set up a configuration file:

$ npx readable --init

After that, you can run readable on any file or directory like this:

$ npx readable

You can also add it to your NPM scripts:

"scripts": {
    "test": "readable"
},
 $ npm run test

Exit code

0
No errors
1
Found errors
2
Unexpected behaviour

Configuration

After running readable --init, you'll have a .readable.json file in your directory. In it, you'll see some rules configured like this:

{
  "paths": [
    "src/",
    "!src/vendor/"
  ],
  "rules": {}
}

Start a path with ! to ignore the folder.

Baseline

If you have a bunch of errors and you don't want to fix them all at once, readable can ignore errors in existing code, while ensuring that new code doesn't have errors:

$ npx readable --save-base-line .baseline.json

will generate or update .baseline.json file containing the current errors. Add "baseline" param to your .readable.json:

{
  "baseline": ".baseline.json",
  "..."
}

You can commit the changes so that readable running in other places (e.g. CI) won't complain about those errors. If you want to see all errors run with --disable-base-line flag:

$ npx readable --disable-base-line

Rules

See Rules and default configuration for default rules. Or read how to create a custom rule.

Development

To lint code run:

npm run lint

To fix lint:

$ npm run fix

To test:

$ npm run test

To update api docs:

$ npm run docs

While developing you can update to latest master with

$ npm install @officient/readable@latest

FAQs

Package last updated on 02 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc