Download the PHP package unionofrad/li3_quality without Composer
On this page you can find all versions of the php package unionofrad/li3_quality. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download unionofrad/li3_quality
More information about unionofrad/li3_quality
Files in unionofrad/li3_quality
Package li3_quality
Short Description This li₃ plugin adds code quality assurance to your toolbelt.
License BSD-3-clause
Homepage http://li3.me
Informations about the package li3_quality
Quality
This li₃ plugin adds code quality assurance to your toolbelt.
Key Features
- Detect coding-standard violations.
- Find weak- or untested classes/methods.
- No external dependencies.
- Color-Highlighting.
- Integrates into the Lithium test dashboard.
- Runs on Windows without hassle.
- Cool shortcuts to ease your workflow.
Installation
The preferred installation method is via composer. You can add the library as a dependency via:
li₃ libraries must be registered within your application bootstrap phase as they use a different (faster) autoloader.
If you open the test dashboard (under /test
in your browser), you should
have an additional Syntax
button to check the files directly in your browser.
Usage: The "syntax" command
If you just run it with li3 syntax
, it will run all rules against your app
library.
Usage: The "fix" command
The fix command helps in migrating code to newer versions. It'll rewrite existing source code files and update them in place. Please note that you should use a version control system when using this command, as the results may not always be 100% what you'd expect.
Custom Rules & Rule Sets
Rule based commands (syntax and fix) will work only with a rule set configuration file.
If none is provided through the --config=<FILE>
option, these commands fall back
to use the default configuration files in config/syntax.json
and config/fix.json
respectively.
Custom rules must be create as i.e.
<your library>/extensions/qa/rules/{syntax,fix}/YourCustomRule.php
.
GIT Pre Commit Hook
This pre commit hook is based upon the example found in .git/hooks/pre-commit.sample
. Copy
the sample script to /path/to/project/.git/hooks/pre-commit
and make it executable. Then,
replace the code in the script with the code shown below and adjust the paths to the plugin and
the li3 command.
Now add the following code to .git/hooks/pre-commit and adjust the APP
and LI3
values.
Now when committing each file the syntax is checked. The commit is aborted if a check failed. If you don't want to have the hook run on commit pass the --no-verify
option to git commit.
Usage: The "coverage" command
With li3 coverage
you can get a summary of how well your classes are covered with tests. This makes use of some xdebug
functions, so make sure to have it installed.
You can also reuse the --library
argument as well. In addition, this command provides an optional --threshold
argument that only displays coverage below the given amount. This defaults to 100, so all classes will be shown. If you have coloring on your shell (likely not on windows), then the classes are colored to reflect the coverage policy of the Lithium framework (0% or no test is red, 85% or higher is green and the rest is yellow).
Copyright & License
Copyright 2011 Union of RAD. All rights reserved. This library is distributed under the terms of the BSD 3-Clause License. The full license text can be found in the LICENSE.txt file.