Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ziesski committed Oct 27, 2023
1 parent f375a38 commit c3a7039
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions _docs/developer/testing/linting_static_analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,31 @@ php vendor/bin/phpstan analyze app public/index.php socket/index.php --generate-
The argument `--memory_limit 2G` is necessary when phpstan will otherwise not have enough memory
to generate a new baseline. You can see how much memory phpstan has been using with the `-v` flag

## submitty_test script for PHP
# Submitty Test Script for PHP Linting

There is a script for php static analysis and code sniffer
Just like submitty_install_site, you can use "submitty_test php-lint" inside your VM.
The `submitty_test` script is an alias for the `SUBMITTY_TEST.sh` script, similar to `submitty_install_site`.
This script streamlines the process of PHP linting by performing the following steps:

1. Changes the directory to `GIT_CHECKOUT/Submitty/site`.
2. Installs Composer if not already installed (skips if Composer is already installed).
3. Executes the specified PHP linting command.
4. Returns to the original directory.

## Commands:

- `phpcs`: Runs PHP CodeSniffer.
- `phpstan`: Runs PHP static analysis.
- `php-lint`: Runs both PHP CodeSniffer and PHPStan.

## Additional Arguments:

The `submitty_test` script accepts additional arguments, such as `--memory_limit 2G`.

## Example Usage:

```
submitty_test php-lint --memory-limit 2G
```

## JavaScript Linting

Expand Down

0 comments on commit c3a7039

Please sign in to comment.