Skip to content
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

Update phpcs.md #967

Merged
merged 1 commit into from
Apr 16, 2024
Merged
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
14 changes: 14 additions & 0 deletions general/development/tools/phpcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ composer global require moodlehq/moodle-cs

This ensures that you have a single copy of the standard used for all code.

Updates to the CodeSniffer are not applied automatically. To determine if updates are required, run the following via the command line:

```console
composer global show -l
```

To apply updates:

```console
composer global update
```

### Configuration

<Since versions={["4.1.0", "4.0.1", "3.11.7"]} issueNumber="MDL-74511" />
Expand Down Expand Up @@ -127,6 +139,8 @@ Many modern editors and IDEs will natively integrate with PHPCodeSniffer, and si

For older versions many editors will allow you to manually configure the PHPCodeSniffer standard to use, for example, the [VS Code PHPCodeSniffer extension](https://marketplace.visualstudio.com/items?itemName=obliviousharmony.vscode-php-codesniffer) can be configured in this way.

If you get the error: 'ERROR: Referenced sniff "moodle" does not exist', you may need to specify the location of the CodeSniffer in your IDE. Note the location when installing, and add that to the settings. e.g. "Exec: Linux": "/home/xxxx/.config/composer/vendor/bin/phpcs"; and select "Automatic" as the Standard.

## Advanced Usage

### Ignoring warnings
Expand Down
Loading