From f66cccdbcffe42ae3e3a614be17e4449f82ab224 Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Wed, 20 Mar 2024 20:39:58 +0000 Subject: [PATCH] Updating the package --- .gitattributes | 4 +- .github/workflows/cs-fixer.yml | 23 +++++++++ .github/workflows/run-tests.yml | 18 ++----- .gitignore | 7 ++- .scrutinizer.yml | 35 -------------- README.md | 7 +-- composer.json | 8 +++- pint.json | 85 +++++++++++++++++++++++++++++++++ 8 files changed, 126 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/cs-fixer.yml delete mode 100644 .scrutinizer.yml create mode 100644 pint.json diff --git a/.gitattributes b/.gitattributes index 22f739a..99c8ea1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,6 +6,6 @@ .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore -.scrutinizer.yml export-ignore -phpunit.xml.dist export-ignore CONTRIBUTING.md export-ignore +phpunit.xml.dist export-ignore +pint.json export-ignore diff --git a/.github/workflows/cs-fixer.yml b/.github/workflows/cs-fixer.yml new file mode 100644 index 0000000..97b433c --- /dev/null +++ b/.github/workflows/cs-fixer.yml @@ -0,0 +1,23 @@ +name: Check & Fix styling + +on: [push] + +jobs: + cs-fixer: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + + - name: "laravel-pint" + uses: aglipanci/laravel-pint-action@latest + with: + verboseMode: true + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Fix the code styling diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 949cd6b..85a9391 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -16,12 +16,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 2 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.composer/cache/files key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} @@ -30,19 +28,11 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv - tools: composer:v2 + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv coverage: pcov - name: Install dependencies run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction - name: Execute tests - run: | - mkdir -p build/logs - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover - - - name: Scrutinizer CI - run: | - composer require scrutinizer/ocular --dev -W - vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover + run: composer test:ci diff --git a/.gitignore b/.gitignore index cb1299f..339b2ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ -/build/ -/vendor/ +/.idea +/.phpunit.cache +/build +/vendor /composer.lock /composer.phar +.phpunit.result.cache diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 69d4755..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,35 +0,0 @@ -filter: - excluded_paths: [tests/*, vendor/*] - -checks: - php: - code_rating: true - duplication: true - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true - -tools: - external_code_coverage: - timeout: 600 - runs: 4 - php_code_sniffer: - enabled: true - config: - standard: PSR2 - filter: - paths: ['src'] - php_loc: - enabled: true - php_cpd: - enabled: true diff --git a/README.md b/README.md index 469e1b7..fa8ca44 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # SEO Helper [![Packagist License][badge_license]](LICENSE.md) [![For PHP][badge_php]][link-github-repo] [![Github Workflow Status][badge_build]][link-github-status] -[![Coverage Status][badge_coverage]][link-scrutinizer] -[![Scrutinizer Code Quality][badge_quality]][link-scrutinizer] [![SensioLabs Insight][badge_insight]][link-insight] [![Github Issues][badge_issues]][link-github-issues] @@ -18,7 +16,7 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/SEO-Helper/re ### Features - * Framework agnostic package. + * Framework-agnostic package. * Open Graph & Twitter Cards are supported. * Webmaster tools site verifier tags are supported. * Google Analytics tracking code is supported. @@ -52,8 +50,6 @@ If you discover any security related issues, please email arcanedev.maroc@gmail. [badge_php]: https://img.shields.io/badge/PHP-Framework%20agnostic-4F5B93.svg?style=flat-square [badge_license]: https://img.shields.io/packagist/l/arcanedev/seo-helper.svg?style=flat-square [badge_build]: https://img.shields.io/github/workflow/status/ARCANEDEV/SEO-Helper/run-tests?style=flat-square -[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/SEO-Helper.svg?style=flat-square -[badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/SEO-Helper.svg?style=flat-square [badge_insight]: https://img.shields.io/sensiolabs/i/73e1a779-7ca7-4a75-b6d3-452d7852187e.svg?style=flat-square [badge_issues]: https://img.shields.io/github/issues/ARCANEDEV/SEO-Helper.svg?style=flat-square [badge_package]: https://img.shields.io/badge/package-arcanedev/seo--helper-blue.svg?style=flat-square @@ -66,5 +62,4 @@ If you discover any security related issues, please email arcanedev.maroc@gmail. [link-github-issues]: https://github.com/ARCANEDEV/SEO-Helper/issues [link-contributors]: https://github.com/ARCANEDEV/SEO-Helper/graphs/contributors [link-packagist]: https://packagist.org/packages/arcanedev/seo-helper -[link-scrutinizer]: https://scrutinizer-ci.com/g/ARCANEDEV/SEO-Helper/?branch=master [link-insight]: https://insight.sensiolabs.com/projects/73e1a779-7ca7-4a75-b6d3-452d7852187e diff --git a/composer.json b/composer.json index 921c92b..6835d0d 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "require-dev": { "ext-dom": "*", "laravel/framework": "^9.0", + "laravel/pint": "^1.14", "orchestra/testbench-core": "^7.0", "phpunit/phpunit": "^9.5.10" }, @@ -39,8 +40,11 @@ } }, "scripts": { - "test": "phpunit", - "coverage": "phpunit --coverage-html build/coverage/html" + "test": "phpunit --colors=always", + "test:dox": "phpunit --testdox --colors=always", + "test:ci": "phpunit --coverage-text", + "cs:fix": "pint -v", + "cs:test": "pint --test -v" }, "extra": { "branch-alias": { diff --git a/pint.json b/pint.json new file mode 100644 index 0000000..be5a613 --- /dev/null +++ b/pint.json @@ -0,0 +1,85 @@ +{ + "preset": "per", + "rules": { + "align_multiline_comment": true, + "array_indentation": true, + "array_syntax": true, + "blank_line_after_namespace": true, + "blank_line_after_opening_tag": true, + "combine_consecutive_issets": true, + "combine_consecutive_unsets": true, + "concat_space": { + "spacing": "one" + }, + "declare_parentheses": true, + "declare_strict_types": true, + "explicit_string_variable": true, + "fully_qualified_strict_types": true, + "global_namespace_import": { + "import_classes": true, + "import_constants": true, + "import_functions": true + }, + "is_null": true, + "lambda_not_used_import": true, + "logical_operators": true, + "mb_str_functions": true, + "method_chaining_indentation": true, + "modernize_strpos": true, + "new_with_braces": true, + "no_empty_comment": true, + "not_operator_with_space": true, + "ordered_traits": true, + "protected_to_private": true, + "simplified_if_return": true, + "strict_comparison": true, + "ternary_to_null_coalescing": true, + "trim_array_spaces": true, + "use_arrow_functions": true, + "void_return": true, + "yoda_style": { + "always_move_variable": true, + "equal": false, + "identical": false, + "less_and_greater": false + }, + "array_push": true, + "assign_null_coalescing_to_coalesce_equal": true, + "explicit_indirect_variable": true, + "method_argument_space": { + "on_multiline": "ensure_fully_multiline" + }, + "modernize_types_casting": true, + "no_superfluous_elseif": true, + "no_useless_else": true, + "nullable_type_declaration_for_default_null_value": true, + "ordered_imports": { + "sort_algorithm": "alpha" + }, + "ordered_class_elements": { + "order": [ + "use_trait", + "case", + "constant", + "constant_public", + "constant_protected", + "constant_private", + "property_public", + "property_protected", + "property_private", + "construct", + "destruct", + "magic", + "phpunit", + "method_abstract", + "method_public_static", + "method_public", + "method_protected_static", + "method_protected", + "method_private_static", + "method_private" + ], + "sort_algorithm": "none" + } + } +}