Skip to content

Commit

Permalink
Updated codesniffer.yml - now creates a .phpcs.xml file
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanVester authored Oct 18, 2024
1 parent 837e472 commit db11110
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/codesniffer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,21 @@ jobs:
composer global config minimum-stability dev
composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global require moodlehq/moodle-cs
composer require --dev phpcompatibility/php-compatibility
# Add Composer global bin to PATH
- name: Add Composer global bin to PATH
run: echo "PATH=$HOME/.composer/vendor/bin:$PATH" >> $GITHUB_ENV

# Create .phpcs.xml file with required content
- name: Create .phpcs.xml file
run: |
cat <<EOT >> ./.phpcs.xml
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="MoodleCore">
<rule ref="./phpcs.xml"/>
<rule ref="moodle-extra"/>
</ruleset>
EOT
# Run PHP_CodeSniffer
- name: Run Code Sniffer
run: phpcs --standard=$HOME/.composer/vendor/moodlehq/moodle-cs/phpcs.xml.dist server/moodle/mod/homework/
run: phpcs server/moodle/mod/homework/

0 comments on commit db11110

Please sign in to comment.