diff --git a/.gitattributes b/.gitattributes index cd81734..c9425c6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -25,7 +25,9 @@ .editorconfig export-ignore text eol=lf .gitattributes export-ignore text eol=lf .gitignore export-ignore text eol=lf +.mega-linter.yml export-ignore text eol=lf .php-cs-fixer.php export-ignore text eol=lf +.phplint.yml export-ignore text eol=lf codecov.yml export-ignore text eol=lf infection.json export-ignore text eol=lf phpcs.xml export-ignore text eol=lf diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 810b8cd..2b41b3b 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -29,7 +29,7 @@ jobs: - "ubuntu-22.04" php-version: - - "7.4" + - "8.1" steps: - name: "Checkout" @@ -50,14 +50,14 @@ jobs: - name: "Validate composer.json" run: "composer validate --strict" - lint: - name: "Linting" + install: + name: "Install dependencies" needs: "validate" runs-on: "${{ matrix.operating-system }}" - continue-on-error: false + continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false @@ -68,10 +68,32 @@ jobs: - "ubuntu-22.04" php-version: - - "7.4" - - "8.0" - "8.1" + dependencies: + - "highest" + - "lowest" + + experimental: [false] + + include: + - operating-system: "ubuntu-20.04" + php-version: "8.2" + dependencies: "highest" + experimental: true + - operating-system: "ubuntu-20.04" + php-version: "8.2" + dependencies: "lowest" + experimental: true + - operating-system: "ubuntu-22.04" + php-version: "8.2" + dependencies: "highest" + experimental: true + - operating-system: "ubuntu-22.04" + php-version: "8.2" + dependencies: "lowest" + experimental: true + steps: - name: "Checkout" uses: "actions/checkout@v3" @@ -88,60 +110,37 @@ jobs: coverage: "none" tools: "${{ env.TOOLS }}" - - name: "Lint PHP" - if: "${{ matrix.php-version == '7.4' }}" - uses: "overtrue/phplint@7.4" + - name: "Update dependencies with composer" + uses: "ramsey/composer-install@v1" + with: + dependency-versions: "${{ matrix.dependencies }}" + composer-options: "${{ env.COMPOSER_OPTIONS }}" - - name: "Lint PHP" - if: "${{ matrix.php-version != '7.4' }}" - uses: "overtrue/phplint@8.0" + - name: "Check dependencies with composer" + run: "composer outdated --direct" - install: - name: "Install dependencies" + lint: + name: "Linting" - needs: "validate" + needs: "install" runs-on: "${{ matrix.operating-system }}" - continue-on-error: ${{ matrix.experimental }} + continue-on-error: false strategy: fail-fast: false matrix: operating-system: - - "ubuntu-18.04" - "ubuntu-20.04" - "ubuntu-22.04" php-version: - - "7.4" - - "8.0" - "8.1" dependencies: - "highest" - - "lowest" - - experimental: [false] - - include: - - operating-system: "ubuntu-20.04" - php-version: "8.2" - dependencies: "highest" - experimental: true - - operating-system: "ubuntu-20.04" - php-version: "8.2" - dependencies: "lowest" - experimental: true - - operating-system: "ubuntu-22.04" - php-version: "8.2" - dependencies: "highest" - experimental: true - - operating-system: "ubuntu-22.04" - php-version: "8.2" - dependencies: "lowest" - experimental: true steps: - name: "Checkout" @@ -165,8 +164,12 @@ jobs: dependency-versions: "${{ matrix.dependencies }}" composer-options: "${{ env.COMPOSER_OPTIONS }}" - - name: "Check dependencies with composer" - run: "composer outdated --direct" + - name: "Linter" + # You can override Mega-Linter flavor used to have faster performances + # More info at https://nvuillam.github.io/mega-linter/flavors/ + uses: "nvuillam/mega-linter/flavors/php@v5" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} php-cs-fixer: name: "Check Coding Standards with PHP-CS-Fixer" @@ -186,7 +189,7 @@ jobs: - "ubuntu-22.04" php-version: - - "7.4" + - "8.1" dependencies: - "highest" @@ -234,7 +237,7 @@ jobs: - "ubuntu-22.04" php-version: - - "7.4" + - "8.1" dependencies: - "highest" @@ -280,7 +283,7 @@ jobs: - "ubuntu-22.04" php-version: - - "7.4" + - "8.1" dependencies: - "highest" @@ -324,13 +327,10 @@ jobs: matrix: operating-system: - - "ubuntu-18.04" - "ubuntu-20.04" - "ubuntu-22.04" php-version: - - "7.4" - - "8.0" - "8.1" dependencies: @@ -376,13 +376,10 @@ jobs: matrix: operating-system: - - "ubuntu-18.04" - "ubuntu-20.04" - "ubuntu-22.04" php-version: - - "7.4" - - "8.0" - "8.1" dependencies: @@ -406,7 +403,7 @@ jobs: extensions: "${{ env.PHP_EXTENSIONS }}" ini-values: "${{ env.PHP_INI_VALUES }}" coverage: "${{ matrix.coverage-drivers }}" - tools: "${{ env.TOOLS }}, infection:0.26.6" + tools: "${{ env.TOOLS }}, infection" - name: "Update dependencies with composer" uses: "ramsey/composer-install@v1" diff --git a/.mega-linter.yml b/.mega-linter.yml new file mode 100644 index 0000000..bf0e5db --- /dev/null +++ b/.mega-linter.yml @@ -0,0 +1,29 @@ +VALIDATE_ALL_CODEBASE: true +LOG_LEVEL: INFO +PRINT_ALPACA: false +SHOW_ELAPSED_TIME: true +FILTER_REGEX_EXCLUDE: (vendor/) +ENABLE: + - EDITORCONFIG + - MARKDOWN + - PHP + - YAML +DISABLE: + - SPELL + #- COPYPASTE +DISABLE_LINTERS: + - MARKDOWN_MARKDOWN_TABLE_FORMATTER + - PHP_PSALM + - PHP_PHPCS + - PHP_PHPSTAN + - YAML_V8R +EDITORCONFIG_EDITORCONFIG_CHECKER_FILTER_REGEX_EXCLUDE: "(\\.idea|\\.editorconfig|\\.github|\\.phpunit\\.result\\.cache|LICENSE)" +JSON_PRETTIER_FILTER_REGEX_EXCLUDE: "(composer\\.json)" +MARKDOWN_MARKDOWNLINT_FILTER_REGEX_EXCLUDE: "(\\.github)" +MARKDOWN_MARKDOWN_LINK_CHECK_FILTER_REGEX_EXCLUDE: "(\\.github)" +PHP_PHPCS_CONFIG_FILE: "phpcs.xml" +PHP_PHPCS_ARGUMENTS: "-n" +PHP_PHPSTAN_CONFIG_FILE: "phpstan.neon" +PHP_PHPSTAN_FILTER_REGEX_INCLUDE: "(src)" +YAML_YAMLLINT_FILTER_REGEX_EXCLUDE: "(\\.github)" +YAML_PRETTIER_FILTER_REGEX_EXCLUDE: "(\\.github)" diff --git a/README.md b/README.md index 7e57907..f79aa1e 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ This library requires PHP 7.4+. Run -``` -$ composer require mimmi20/contact +```shell +composer require mimmi20/contact ``` ## License diff --git a/composer.json b/composer.json index 2f5548a..56293b8 100644 --- a/composer.json +++ b/composer.json @@ -20,15 +20,15 @@ "source": "https://github.com/mimmi20/contact" }, "require": { - "php": "^7.4.3 || ^8.0.0" + "php": "^8.1.0" }, "require-dev": { - "mimmi20/coding-standard": "^2.8.0", + "mimmi20/coding-standard": "^2.9.0", "phpstan/extension-installer": "^1.1.0", - "phpstan/phpstan": "^1.6.8", + "phpstan/phpstan": "^1.8.0", "phpstan/phpstan-deprecation-rules": "^1.0.0", "phpstan/phpstan-phpunit": "^1.1.1", - "phpunit/phpunit": "^9.5.20" + "phpunit/phpunit": "^9.5.21" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/phpcs.xml b/phpcs.xml index 242439c..53b6d38 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,8 +1,5 @@ - + contact