Skip to content

README and yml updates #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
exclude_paths:
- "/lib/testing.php"
- "/vendor/"
- "/vendor/*"
engines:
phpcodesniffer:
enabled: true
config:
- file_extensions: "php"
- standard: "PSR1","PSR2"
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
# Code Climate PHP Code Sniffer Engine
# Code Climate PHP_CodeSniffer Engine

`codeclimate-phpcodesniffer` is a Code Climate engine that wraps the [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) static analysis tool. You can run it on your command line using the Code Climate CLI, or on our hosted analysis platform.

PHP Code Sniffer helps you detect violations of a defined coding standard.
PHP_CodeSniffer helps you detect violations of a defined coding standard.

### Installation

1. If you haven't already, [install the Code Climate CLI](https://github.com/codeclimate/codeclimate).
2. Run `codeclimate engines:enable phpcodesniffer`. This command both installs the engine and enables it in your `.codeclimate.yml` file.
3. You're ready to analyze! Browse into your project's folder and run `codeclimate analyze`.

###Config Options

Format the values for these config options per the [PHP_CodeSniffer documentation](https://github.com/squizlabs/PHP_CodeSniffer).

1. custom_exclude_paths - These are files that you want to exclude from the PHP_CodeSniffer analysis, but not from other Code Climate analyses.
2. file_extensions - This is where you can configure the file extensions for the files that you want PHP_CodeSniffer to analyze.
3. standard - This is the list of standards that you want PHP_CodeSniffer to use while analyzing your files.

###Sample Config

exclude_paths:
- "/examples/*
engines:
phpcodesniffer:
enabled: true
config:
- custom_exclude_paths: "*/test.php","/vendor/"
- file_extensions: "php,inc,lib"
- standard: "PSR1","PSR2"

### Need help?

For help with PHP Code Sniffer, [check out their documentation](https://github.com/squizlabs/PHP_CodeSniffer).
For help with PHP_CodeSniffer, [check out their documentation](https://github.com/squizlabs/PHP_CodeSniffer).

If you're running into a Code Climate issue, first look over this project's [GitHub Issues](https://github.com/squizlabs/PHP_CodeSniffer/issues), as your question may have already been covered. If not, [go ahead and open a support ticket with us](https://codeclimate.com/help).
2 changes: 1 addition & 1 deletion engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
'end' => $phpcs_issue_data['line']
)
),
'remediation_points' => $phpcs_issue_data['severity'] * $phpcs_issue_data['severity'] * 100
'remediation_points' => $phpcs_issue_data['severity'] * 75000
);
$iterations++;

Expand Down