Skip to content

Commit

Permalink
[Documentation:System] php lint script documentation (#555)
Browse files Browse the repository at this point in the history
Detailed instruction on submitty test script and its current commands
  • Loading branch information
ziesski authored Oct 28, 2023
1 parent 9556133 commit 96f9d88
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions _docs/developer/testing/linting_static_analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,32 @@ 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 Linting

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

The frontend JavaScript code Submitty uses is linted using [eslint](https://eslint.org/).
Expand Down

0 comments on commit 96f9d88

Please sign in to comment.