From 6fc6e39c2bd45f3a427883ee16bb740648fd2c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Sun, 5 Nov 2023 18:53:06 +0100 Subject: [PATCH] updates --- .github/dependabot.yml | 21 +++++++++------ .github/workflows/gh-pages.yaml | 45 +++++++++++++++++++-------------- .markdownlint.jsonc | 10 ++++++++ Makefile | 16 ++++++++++++ README.md | 7 ++--- UPGRADE.md | 14 +++++----- doc/code-isolation.md | 4 +-- 7 files changed, 79 insertions(+), 38 deletions(-) create mode 100644 .markdownlint.jsonc diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e2277c3ae..ee9d84b59 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,10 +1,15 @@ version: 2 updates: - - package-ecosystem: "composer" - directory: "/" - schedule: - interval: "weekly" - groups: - dependencies: - patterns: - - "*" + - package-ecosystem: "composer" + directory: "/" + schedule: + interval: "weekly" + groups: + dependencies: + patterns: + - "*" + + - package-ecosystem: "github-actions" + directory: ".github/workflows" + schedule: + interval: "weekly" diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml index 7da2bf42c..f09cf258c 100644 --- a/.github/workflows/gh-pages.yaml +++ b/.github/workflows/gh-pages.yaml @@ -24,37 +24,44 @@ env: jobs: check-markdown: - name: "Lint Markdown" - runs-on: "ubuntu-22.04" + name: Lint Markdown + runs-on: ubuntu-22.04 timeout-minutes: 1 steps: - - - name: "Checkout repository" - uses: "actions/checkout@v3.6.0" - - - name: "Check Markdown formatting" - uses: "DavidAnson/markdownlint-cli2-action@v13.0.0" + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Check Markdown formatting + uses: DavidAnson/markdownlint-cli2-action@v13.0.0 with: - globs: "**/*.md" + globs: "*.md|docs/**/*.md" check-links: - name: "Lint Links" - runs-on: "ubuntu-22.04" + name: Lint Links + runs-on: ubuntu-22.04 timeout-minutes: 10 steps: - - - name: "Checkout repository" - uses: "actions/checkout@v3.6.0" - - - name: "Run Lychee" - uses: "lycheeverse/lychee-action@v1.8.0" + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Restore lychee cache + uses: actions/cache@v3 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + + - name: Run Lychee + uses: lycheeverse/lychee-action@v1.8.0 with: - output: "${{ runner.temp }}/lychee/out.md" + # To keep in sync with Makefile#lychee + args: "--verbose --no-progress '*.md' 'docs/**/*.md' --cache --max-cache-age 1d ." + output: ${{ runner.temp }}/lychee/out.md fail: true build: runs-on: ubuntu-latest - name: Deploy website + name: Build docs permissions: contents: write steps: diff --git a/.markdownlint.jsonc b/.markdownlint.jsonc new file mode 100644 index 000000000..ea8565914 --- /dev/null +++ b/.markdownlint.jsonc @@ -0,0 +1,10 @@ +{ + "MD007": false, + "MD012": false, + "MD013": false, + "MD024": false, + "MD029": false, + "MD033": false, + "MD034": false, + "MD041": false, +} \ No newline at end of file diff --git a/Makefile b/Makefile index 18ffa3765..0ab7620e6 100644 --- a/Makefile +++ b/Makefile @@ -284,6 +284,22 @@ blackfire: $(SCOPED_BOX_BIN) # Website rules #--------------------------------------------------------------------------- +.PHONY: website_check +website_check: ## Runs various checks for the website +website_check: markdownlint lychee website_build + +.PHONY: markdownlint +markdownlint: + @echo "$(YELLOW_COLOR)Ensure you have the nodejs & npm installed. For more information, check:$(NO_COLOR)" + @# To keep in sync with .github/workflows/gh-pages.yaml#check-links + npx markdownlint-cli2 "*.md|docs/**/*.md" + +.PHONY: lychee +lychee: + @echo "$(YELLOW_COLOR)Ensure you have the lychee command installed. For more information, check:$(NO_COLOR)" + @echo "https://github.com/lycheeverse/lychee" + @# To keep in sync with .github/workflows/gh-pages.yaml#check-links + lychee --verbose --no-progress '*.md' 'docs/**/*.md' .PHONY: website_build website_build: ## Builds the website diff --git a/README.md b/README.md index e0bbbbfa0..24592d0bd 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ great things: - 🔨 [PHAR isolation](doc/code-isolation.md#phar-code-isolation) - ⚙️ Zero configuration by default - 🚔 [Requirements checker](doc/requirement-checker.md#requirements-checker) -- 🚨 Friendly error logging experience +- 🚨 Friendly error logging experience - 🔍 Retrieve information about the PHAR extension or a PHAR file and its contents (`box info` or `box diff`) - 🔐️ Verify the signature of an existing PHAR (`box verify`) - 📝 Use Git tags and short commit hashes for versioning @@ -153,7 +153,7 @@ permissions: You can then find more advanced configuration settings in [the configuration documentation][configuration]. For more information on which command or options is available, you can run: -``` +```shell box help ``` @@ -171,7 +171,7 @@ make ## Backward Compatibility Promise (BCP) The policy is for the major part following the same as [Symfony's one][symfony-bc-policy]. Note that the code marked -as `@private` or `@internal` are excluded from the BCP. +as `@private` or `@internal` are excluded from the BCP. The text displayed by the commands (e.g. `compile` or `info`) or the content of the error/exception messages are also not subject to the BCP. @@ -182,6 +182,7 @@ Project originally created by: [Kevin Herrera] ([@kherge]) which has now been mo [box2]: https://github.com/box-project/box2 +[configuration]: doc/configuration.md#configuration [Kevin Herrera]: https://github.com/kherge [@kherge]: https://github.com/kherge [humbug]: https://github.com/humbug diff --git a/UPGRADE.md b/UPGRADE.md index 11442614b..8bdcf34df 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -10,7 +10,7 @@ - Bump to PHP 8.1 #613 - Remove the build command (#623): the `build` command has been deprecated since 3.0.0 in favour of `compile`. - Remove support for legacy compactors (#626). Here are the replacements: - - `Herrera\Box\Compactor\Json` -> `KevinGH\Box\Compactor\Json` + - `Herrera\Box\Compactor\Json` -> `KevinGH\Box\Compactor\Json` - `Herrera\Box\Compactor\Php` -> `KevinGH\Box\Compactor\Php` - Drop PHP5.3 support for the RequirementChecker - new min is 7.2.4+ (#674). This is to align the project with Composer. It is technically possible to restore support for PHP5.3 but requires some work, see @@ -22,21 +22,23 @@ - Changes to the `Php` compactor: - Invalid annotations are no longer recognised as annotations: + ```php /** * @Annotation () * @Namespaced\ Annotation */ ``` - + Will be transformed into: - + ```php /** * @Annotation * @Namespaced */ ``` + - The removal of common annotations is enabled by default - The setting `annotation#ignore` no longer accepts a `string` value, only `string[]` and `null` are allowed - Upon some annotation parsing failures, the error is thrown to the user in order to identify and fix those cases @@ -48,9 +50,9 @@ * \@NotEscaped */ ``` - + Indeed it will be compacted to: - + ```php /** @NotEscaped @@ -69,7 +71,7 @@ The change from 2.x to 3.x is quite significant but should be really smooth for - Automatically remove the dev dependencies - No longer requires a `phar.readonly` or `ulimit` setting change from the user - [Allows to scope the PHAR](doc/code-isolation.md#phar-code-isolation) -- [Allows to ship with a requirements checker](doc/requirement-checker.md#requirements-checker) +- [Allows to ship with a requirements checker](doc/requirement-checker.md#requirements-checker) A few more features landed as well and a range of settings were added more, the whole list of BC breaks can be found diff --git a/doc/code-isolation.md b/doc/code-isolation.md index d4db45579..bb07a4d24 100644 --- a/doc/code-isolation.md +++ b/doc/code-isolation.md @@ -34,7 +34,7 @@ Is this really an issue? The answer is it depends. Here as a few real life examp - A static analysis tool like [PHPStan][phpstan] - A test framework like [PHPUnit][phpunit] -- A quality analysis tool like [SensioLabsInsight][sensiolabs-insight] which executes arbitrary code (e.g. to check) +- A quality analysis tool like [SymfonyInsight][symfony-insight] which executes arbitrary code (e.g. to check) that the application is booting - A piece of code that can be mixed with any code, such as a Wordpress plugin @@ -77,7 +77,7 @@ there is two recommendations: [phpstan]: https://github.com/phpstan/phpstan [phpunit]: https://github.com/sebastianbergmann/phpunit -[sensiolabs-insight]: https://insight.sensiolabs.com +[symfony-insight]: https://insight.symfony.com/ [php-scoper]: https://github.com/humbug/php-scoper [php-scoper-compactor]: configuration.md#compactors-compactors [php-scoper-config]: https://github.com/humbug/php-scoper#configuration