Skip to content

Commit

Permalink
feat: wpcs workflow and code quality improved (#31)
Browse files Browse the repository at this point in the history
* feat: analizing all files with Wordpress CS

* refactor: wordpress coding standard corrections

* fix: unit testing new admin file name based on WPCS

* refactor: exclusions removed and WPCS corrections

* fix: set end of line char as \n

* fix: deleted autogenerated unnecessary files

* refactor: ignore singular string rule

* fix: deleted phpunit cache file

* refactor: improved wpcs workflow name

* fix: added end of line

* fix: end of line added to phpcs xml

* fix: deleted vendor directory because merge conflicts

* fix: updated composer with required dependencies
  • Loading branch information
julianramirez2 authored Aug 30, 2023
1 parent 8cd6d58 commit 50f9cb1
Show file tree
Hide file tree
Showing 41 changed files with 2,973 additions and 2,463 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
with:
find: "Version: *[0-9.]*"
replace: "Version: ${{ steps.tag_version.outputs.new_version }}"
include: "openedx-woocommerce-plugin.php"
include: "class-openedx-woocommerce-plugin.php"

- name: Update php file version - define statement
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "(define\\( 'OPENEDX_WOOCOMMERCE_PLUGIN_VERSION', ')([^']*)(.*);"
replace: "define( 'OPENEDX_WOOCOMMERCE_PLUGIN_VERSION', '${{ steps.tag_version.outputs.new_version }}' );"
include: "openedx-woocommerce-plugin.php"
include: "class-openedx-woocommerce-plugin.php"

- name: Update README version
uses: jacobtomlinson/gha-find-replace@v3
Expand All @@ -60,7 +60,7 @@ jobs:
with:
branch: ${{ github.ref }}
commit_message: "docs(bumpversion): ${{ steps.tag_version.outputs.previous_tag }} → ${{ steps.tag_version.outputs.new_tag }}"
file_pattern: README.txt CHANGELOG.md openedx-woocommerce-plugin.php
file_pattern: README.txt CHANGELOG.md class-openedx-woocommerce-plugin.php

release:
needs: bumpversion
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/linting.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/wordpress-cs-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: WordPress Coding Standards check
on:
pull_request

jobs:
phpcs:
name: PHPCS check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: 'latest'
ini-values: memory_limit=1G'
coverage: none
tools: cs2pr

- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Run PHPCS checks
id: phpcs
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml --standard=phpcs.xml

- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
run: cs2pr ./phpcs-report.xml
Loading

0 comments on commit 50f9cb1

Please sign in to comment.