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

[Documentation:System] php lint script documentation #555

Merged
merged 2 commits into from
Oct 28, 2023
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
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
Loading