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

HSD8-000: Add phpcs (Drupal PHP CodeSniffer) to CI #1686

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
30 changes: 22 additions & 8 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# READY FOR REVIEW

## Summary
_[briefly summarize the changes here]_
# Summary
_[briefly summarize the changes here. TL;DR - what's this PR for?]_

## Need Review By (Date)
_['10/30', 'asap', etc.]_
_[When does this need to be reviewed by? '10/30', 'asap', etc.]_

## Urgency
_['low', 'medium', 'high', etc.]_
Expand All @@ -13,6 +11,22 @@ _['low', 'medium', 'high', etc.]_
1. _[First testing step]_
2. ...

## PR Checklist
- [PR Checklist](https://gist.github.com/sherakama/0ba17601381e3adbe0cad566ad4d80a5)
- [Humsci Basic PR Checklist](https://github.com/SU-HSDO/suhumsci/blob/develop/docs/HumsciBasicPRChecklist.md)
# Review Tasks

## Backend / Functional Validation
### Code
- [ ] Are the naming conventions following our standards?
- [ ] Are PHP functions and variables in `snake_case` and not `camelCase`?
- [ ] Does Drupal code follow [Drupal Coding Standards](https://www.drupal.org/docs/develop/standards/php/php-coding-standards)?
- [ ] Does the code have sufficient inline comments?
- [ ] Is there anything in this code that would be hidden or hard to discover through the UI?
- [ ] Are there any [code smells](https://blog.codinghorror.com/code-smells/)?
- [ ] Are tests provided?

### Code security
- [ ] Is all [user input properly sanitized when rendered](https://www.drupal.org/docs/8/security/drupal-8-sanitizing-output)?
- [ ] Any obvious [security flaws or new areas for attack](https://www.drupal.org/docs/8/security)?

### General
- [ ] Is there anything included in this PR that is not related to the problem it is trying to solve?
- [ ] Is the approach to the problem appropriate?
33 changes: 33 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Drupal PHP CodeSniffer
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run_phpcs:
runs-on: ubuntu-latest
container:
image: pookmish/drupal8ci:php8.3
steps:
- uses: actions/checkout@v4
- name: Restore Cache
uses: actions/cache@v4
with:
path: |
vendor
docroot/core
docroot/libraries
docroot/modules/contrib
key: 1.0-${{ hashFiles('blt/blt.yml') }}-${{ hashFiles('composer.json') }}-${{ hashFiles('composer.lock') }}
restore-keys: |
1.0-${{ hashFiles('blt/blt.yml') }}-${{ hashFiles('composer.json') }}-${{ hashFiles('composer.lock') }}
1.0-${{ hashFiles('blt/blt.yml') }}-${{ hashFiles('composer.json') }}-
1.0-${{ hashFiles('blt/blt.yml') }}-
- name: Run PHPCS
run: |
composer install -n &&
vendor/bin/phpcs --standard=./phpcs.dist.xml




7 changes: 1 addition & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,12 @@
"su-sws/stanford_samlauth": "^1.0"
},
"require-dev": {
"drupal/core-dev": "~10.3.0",
"drupal/upgrade_status": "^4.0",
"phpspec/prophecy-phpunit": "^2.0",
"su-sws/blt-sws": "dev-main",
"su-sws/drupal-dev": "^10"
},
"replace": {
"drupal/coder": "*"
},
"conflict": {
"drupal/drupal": "*",
"drupal/gin": ">3.0.0-rc13"
Expand Down Expand Up @@ -356,9 +354,6 @@
"enyo/dropzone",
"components/jquery",
"harvesthq/chosen"
],
"vendor/{$vendor}/{$name}/": [
"type:library"
]
}
},
Expand Down
Loading
Loading