-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: update qa tools #200
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
Open
Morgy93
wants to merge
4
commits into
main
Choose a base branch
from
update-qa
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,19 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| ## Description: Run Mago (PHP analysis, formatting, and linting) | ||
| set -euo pipefail | ||
|
|
||
| ## Description: Run Mago (PHP linter and formatter) | ||
| ## Usage: mago <command> [options] | ||
| ## Example: "ddev mago" | ||
| ## Example: ddev mago lint | ||
| ## Example: ddev mago fmt | ||
| ## Example: ddev mago fmt --dry-run | ||
|
|
||
| set -e | ||
| cd /var/www/html | ||
|
|
||
| # Require Mago to be installed (avoid executing remote install scripts automatically) | ||
| if ! command -v mago >/dev/null 2>&1; then | ||
| echo "mago is not installed. Please install it first: https://carthage.software/mago" | ||
| exit 1 | ||
| # Mago is a require-dev dependency of the module itself. | ||
| if [[ ! -x vendor/bin/mago ]]; then | ||
| echo "mago not found. Installing module dev dependencies..." | ||
| composer install --no-interaction | ||
| fi | ||
|
|
||
| # Change to module root where mago.toml is found | ||
| cd /var/www/html | ||
|
|
||
| # Run Mago with provided arguments | ||
| mago "$@" | ||
| vendor/bin/mago "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,42 +1,19 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| ## Description: Run phpcbf (auto-fix coding standard issues) | ||
| ## Usage: phpcbf [path] | ||
| set -euo pipefail | ||
|
|
||
| ## Description: Run PHP Code Beautifier (auto-fix Magento2 standard violations) | ||
| ## Usage: phpcbf [path] [flags] | ||
| ## Example: ddev phpcbf | ||
| ## Example: ddev phpcbf src/Service/StaticContentCleaner.php | ||
| ## Example: ddev phpcbf vendor/openforgeproject/mageforge/src/Block | ||
|
|
||
| cd /var/www/html/magento || exit 1 | ||
|
|
||
| PHPCBF_BIN="vendor-bin/coding-standard/vendor/bin/phpcbf" | ||
| PHPCBF_FALLBACK="vendor-bin/coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcbf" | ||
|
|
||
| if [[ ! -x "${PHPCBF_BIN}" ]]; then | ||
| PHPCBF_BIN="${PHPCBF_FALLBACK}" | ||
| fi | ||
|
|
||
| if [[ ! -x "${PHPCBF_BIN}" ]]; then | ||
| echo "phpcbf not found. Installing coding-standard toolchain..." | ||
| composer bin coding-standard install || exit 1 | ||
| PHPCBF_BIN="${PHPCBF_FALLBACK}" | ||
| fi | ||
|
|
||
| if [[ ! -x "${PHPCBF_BIN}" ]]; then | ||
| echo "phpcbf binary still missing. Expected ${PHPCBF_FALLBACK}." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Set target path - default to vendor/openforgeproject/mageforge/src if not provided | ||
| TARGET_PATH="vendor/openforgeproject/mageforge/src" | ||
| if [[ $# -gt 0 ]] && [[ ! "$1" =~ ^- ]]; then | ||
| TARGET_PATH="$1" | ||
| shift # Remove the first argument | ||
| cd /var/www/html | ||
|
|
||
| # If path doesn't exist from magento dir, try from workspace root | ||
| if [[ ! -e "${TARGET_PATH}" ]] && [[ -e "../${TARGET_PATH}" ]]; then | ||
| TARGET_PATH="../${TARGET_PATH}" | ||
| fi | ||
| # The coding standard is a require-dev dependency of the module itself. | ||
| if [[ ! -x vendor/bin/phpcbf ]]; then | ||
| echo "phpcbf not found. Installing module dev dependencies..." | ||
| composer install --no-interaction | ||
| fi | ||
|
|
||
| # Run PHPCBF with optional additional flags | ||
| "${PHPCBF_BIN}" -p -s --standard=Magento2 "$@" "${TARGET_PATH}" | ||
| # The ruleset (phpcs.xml.dist) defines the standard and default file list. | ||
| vendor/bin/phpcbf -p "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,45 +1,19 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| ## Description: Run phpcs | ||
| ## Usage: phpcs [path] | ||
| set -euo pipefail | ||
|
|
||
| ## Description: Run PHP CodeSniffer (Magento2 standard) on the module source | ||
| ## Usage: phpcs [path] [flags] | ||
| ## Example: ddev phpcs | ||
| ## Example: ddev phpcs src/Service/StaticContentCleaner.php | ||
| ## Example: ddev phpcs vendor/openforgeproject/mageforge/src/Block | ||
|
|
||
| cd /var/www/html/magento || exit 1 | ||
|
|
||
| PHPCS_BIN="vendor-bin/coding-standard/vendor/bin/phpcs" | ||
| PHPCS_FALLBACK="vendor-bin/coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs" | ||
|
|
||
| if [[ ! -x "${PHPCS_BIN}" ]]; then | ||
| PHPCS_BIN="${PHPCS_FALLBACK}" | ||
| fi | ||
|
|
||
| if [[ ! -x "${PHPCS_BIN}" ]]; then | ||
| echo "phpcs not found. Installing coding-standard toolchain..." | ||
| composer bin coding-standard install || exit 1 | ||
| PHPCS_BIN="${PHPCS_FALLBACK}" | ||
| fi | ||
|
|
||
| if [[ ! -x "${PHPCS_BIN}" ]]; then | ||
| echo "phpcs binary still missing. Expected ${PHPCS_FALLBACK}." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Set target path - default to vendor/openforgeproject/mageforge/src if not provided | ||
| TARGET_PATH="vendor/openforgeproject/mageforge/src" | ||
| if [[ $# -gt 0 ]] && [[ ! "$1" =~ ^- ]]; then | ||
| TARGET_PATH="$1" | ||
| shift # Remove the first argument | ||
| cd /var/www/html | ||
|
|
||
| # If path starts with 'src/', convert to vendor path | ||
| if [[ "${TARGET_PATH}" =~ ^src/ ]]; then | ||
| TARGET_PATH="vendor/openforgeproject/mageforge/${TARGET_PATH}" | ||
| # If path doesn't exist from magento dir, try from workspace root | ||
| elif [[ ! -e "${TARGET_PATH}" ]] && [[ -e "../${TARGET_PATH}" ]]; then | ||
| TARGET_PATH="../${TARGET_PATH}" | ||
| fi | ||
| # The coding standard is a require-dev dependency of the module itself. | ||
| if [[ ! -x vendor/bin/phpcs ]]; then | ||
| echo "phpcs not found. Installing module dev dependencies..." | ||
| composer install --no-interaction | ||
| fi | ||
|
|
||
| # Run PHPCS with optional additional flags | ||
| "${PHPCS_BIN}" -p -s --standard=Magento2 "$@" "${TARGET_PATH}" | ||
| # The ruleset (phpcs.xml.dist) defines the standard and default file list. | ||
| vendor/bin/phpcs -p -s "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # EditorConfig: https://editorconfig.org | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_style = space | ||
| indent_size = 4 | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
|
|
||
| # Match Prettier's output (2-space indent) for everything it formats | ||
| [*.{js,mjs,css,json,yml,yaml,md}] | ||
| indent_size = 2 | ||
|
|
||
| [*.md] | ||
| trim_trailing_whitespace = false | ||
|
|
||
| [Makefile] | ||
| indent_style = tab | ||
|
|
||
| # DDEV command scripts are formatted by shfmt with tabs | ||
| [.ddev/commands/**] | ||
| indent_style = tab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,29 @@ | ||
| # actions/labeler v5 config. | ||
| # Only changed-files, head-branch and base-branch are supported here; head-branch | ||
| # values are regexes (not globs). Labeling by PR title is handled by a separate | ||
| # step in .github/workflows/label.yml, since the action cannot match titles. | ||
|
|
||
| Documentation: | ||
| - changed-files: | ||
| - any-glob-to-any-file: '**/*.md' | ||
| - changed-files: | ||
| - any-glob-to-any-file: "**/*.md" | ||
|
|
||
| Feature: | ||
| - branch: ['add-*', 'featuere-*', 'feature/**', 'feat-*', 'feature*'] | ||
| - title: ['feat:', 'feature:', 'Feature:'] | ||
| - head-branch: ["^(add|feat|feature)[/-]"] | ||
|
|
||
| Fix: | ||
| - branch: ['fix-*', 'bugfix-*', 'fix/**', 'bugfix/**', 'fix*', 'bugfix*'] | ||
| - title: ['fix:', 'bugfix:', 'Fix:'] | ||
| - head-branch: ["^(fix|bugfix)[/-]"] | ||
|
|
||
| Next-Release: | ||
| - branch: ['chore: release*', 'release-please*'] | ||
| - title: ['chore: release', 'Release'] | ||
| - head-branch: [^release-please] | ||
|
|
||
| Command: | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'src/Console/Command/**' | ||
| - changed-files: | ||
| - any-glob-to-any-file: src/Console/Command/** | ||
|
|
||
| Frontend: | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'src/view/frontend/**' | ||
| - changed-files: | ||
| - any-glob-to-any-file: src/view/frontend/** | ||
|
|
||
| Theme-Builder: | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'src/Service/ThemeBuilder/**' | ||
| - changed-files: | ||
| - any-glob-to-any-file: src/Service/ThemeBuilder/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.