nette / code-checker
✅ Nette CodeChecker: A simple tool to check source code against a set of Nette coding standards.
Installs: 1 231 729
Dependents: 8
Suggesters: 0
Security: 0
Stars: 86
Watchers: 20
Forks: 28
Open Issues: 1
Type:project
Requires
- php: >= 8.0
- latte/latte: ^3.0.1
- nette/application: ^3.1
- nette/caching: ^3.1
- nette/command-line: ^2.0
- nette/forms: ^3.0
- nette/neon: ^3.0
- nette/utils: ^4.0
Requires (Dev)
- nette/tester: ^2.0
- phpstan/phpstan: ^0.12
- tracy/tracy: ^2.6
This package is auto-updated.
Last update: 2024-12-11 16:31:06 UTC
README
Introduction
The tool called that checks and possibly repairs some of the formal errors in your source code.
Documentation can be found on the website. If you like it, please make a donation now. Thank you!
Usage
Usage: php code-checker [options]
Options:
-d <path> Folder or file to scan (default: current directory)
-i | --ignore <mask> Files to ignore
-f | --fix Fixes files
-l | --eol Convert newline characters
--no-progress Do not show progress dots
--strict-types Checks whether PHP 7.0 directive strict_types is enabled
Without parameters, it checks the current working directory in a read-only mode, with -f
parameter it fixes files.
Before you get to know the tool, be sure to backup your files first.
You can create a batch file, e.g. code.bat
, for easier execution of Code-Checker under Windows:
php path_to\Nette_tools\Code-Checker\code-checker %*
What Code-Checker Does?
- removes BOM
- checks validity of Latte templates
- checks validity of
.neon
,.php
and.json
files - checks for control characters
- checks whether the file is encoded in UTF-8
- controls misspelled
/* @annotations */
(second asterisk missing) - removes PHP ending tags
?>
in PHP files - removes trailing whitespace and unnecessary blank lines from the end of a file
- normalizes line endings to system-default (with the
-l
parameter)
Installation
Install it via Composer. This project is not meant to be run as a dependency, so install it as standalone:
composer create-project nette/code-checker
Or install it globally via:
composer global require nette/code-checker
and make sure your global vendor binaries directory is in your $PATH
environment variable.
It requires PHP version 8.0.