From 34f501a57106dddaf2aeb9f86930fba3e4eff121 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sat, 24 Feb 2024 16:08:04 +0100 Subject: [PATCH] Add phpcs execution to GHA, plus change log updates --- .github/workflows/phpcs.yml | 4 ++++ CHANGELOG.md | 15 +++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index aaa7404..1d1bf9b 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -41,6 +41,10 @@ jobs: if: ${{ !cancelled() }} run: ./vendor/bin/phpcpd --exclude moodle/Tests moodle + - name: Coding style + if: ${{ !cancelled() }} + run: ./vendor/bin/phpcs -s . + - name: Run phpunit if: ${{ !cancelled() }} run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 8068878..ec1d4e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,20 @@ # Change log All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). +This project adheres to [Semantic Versioning](https://semver.org/). -The format of this change log follows the advice given at [Keep a CHANGELOG](http://keepachangelog.com). +The format of this change log follows the advice given at [Keep a CHANGELOG](https://keepachangelog.com). ## [Unreleased] +### Added +- Add new `moodle.Commenting.Package` sniff to replace those present in moodle-local_moodlecheck. +- Add new `moodle.Commenting.Category` sniffs to replace those present in moodle-local_moodlecheck. +- New `phpcs.xml.dist` to enforce the coding style to follow by ´moodle-cs´ itself. Basically, PSR12 ruled. CI verified from now on. + ### Changed - Update composer dependencies to current versions, notably `PHP_CodeSniffer` (3.9.0) and `PHPCompatibility` (e5cd2e24). - -### Added -- Add new moodle.Commenting.Package sniffs to replace those present in moodle-local_moodlecheck. -- Add new moodle.Commenting.Category sniffs to replace those present in moodle-local_moodlecheck. +- As part of the move to be PSR12 compliant, all the methods used for testing have been converted, without deprecation, to camel case (`setStandard()`, `setSniff()`, ...). +- ACTION REQUIRED: Any clone/fork using `moodle-cs` and having own tests will need to adapt them to the new method names. ### Fixed - The moodle.Files.MoodleInternal sniff no longer treats Attributes as side-effects.