Giter Club home page Giter Club logo

phplintbash's Introduction

phpLintBash

A quick bash script to recursively lint PHP files in a given directory. Nice to use as part of a testing stragegy for CI, or after doing an epic merge.

Returns:

  • Number of Files linted
  • Number of Files passed
  • Number of Files failed
  • Offending errors
  • Output on STDERR if any files fail linting
  • Pass / Fail "Sanity check"
  • Proper Exit codes

Usage

$ phpLint

  • Will recursively lint all PHP files in default directory specified in script

$ phpLint [directory]

Lint all files recursively of specified directory

Overview:

  • Will return a pass / fail
  • Will only pass if all files pass
  • Any errors will be output in addition to the file they were found in

Scope:

  • This is a syntax checker. It will not run methods and check for correct returns
  • It is not a static analysis tool. Code quality / specs are not enforced or searched for

Caveats and Best Practice:

  • The nature of PHP's lint operation is to abort linting of a file once an error has been found, so...
  • If a file has multiple errors you will only be notified of the first error
  • Run until you're error-free
  • Although linting of the current file may have stopped due to a syntax error, linting of any remaining files in the queue will continue.

Scripting / Deployment Usage:

  • This will return proper exit codes so it can be used for scripting deployments, etc.
  • Pass
  • Exit 0 (clean)
  • Output on stdin
  • Fail
  • Exit 1
  • Output on stderr

Requires:

  • PHP
  • Bash

phplintbash's People

Contributors

njoannidi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.