diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9db6ceb..24db029 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,10 +1,10 @@ version: 2 updates: - # - # - # [GHAction] - # Based on https://github.com/yoanm/shared-config/blob/master/GitHub/dependabot/github-action.yml file - # +# +# +# [GHAction] +# Based on https://github.com/yoanm/shared-config/blob/master/GitHub/dependabot/github-action.yml file +# - package-ecosystem: github-actions directory: / schedule: @@ -14,22 +14,22 @@ updates: prefix: '[dependabot][ghaction] - ' # No need to specify prod/dev for GHAction as there is only "production" updates ! include: scope groups: - # Group all basic updates inside the a single PR - # No need to split prod/dev as there is only prod updates +# Group all basic updates inside the a single PR +# No need to split prod/dev as there is only prod updates all-actions: applies-to: version-updates patterns: ['*'] - # Group all security updates inside the a single PR - # No need to split prod/dev as there is only prod updates - # +Most likely no need to split major and other updates either +# Group all security updates inside the a single PR +# No need to split prod/dev as there is only prod updates +# +Most likely no need to split major and other updates either SECURITY-all: applies-to: security-updates patterns: ['*'] - # - # - # [Composer] - # Based on https://github.com/yoanm/shared-config/blob/master/GitHub/dependabot/composer.yml file - # +# +# +# [Composer] +# Based on https://github.com/yoanm/shared-config/blob/master/GitHub/dependabot/composer.yml file +# - package-ecosystem: composer directory: / schedule: # Create PRs during week-ends, they will be ready on monday morning @@ -41,9 +41,9 @@ updates: prefix-development: '[dependabot][dev][composer] - ' include: scope groups: - # Split basic updates by: - # - prod vs dev - # - major vs others (assuming packages properly follow semver !) +# Split basic updates by: +# - prod vs dev +# - major vs others (assuming packages properly follow semver !) prod-majors: applies-to: version-updates dependency-type: production @@ -62,9 +62,9 @@ updates: applies-to: version-updates dependency-type: development patterns: ['*'] - # Split security updates by: - # - prod vs dev - # - Major prod updates vs other prod updates +# Split security updates by: +# - prod vs dev +# - Major prod updates vs other prod updates SECURITY-prod-major: applies-to: security-updates dependency-type: production diff --git a/.github/workflows/coverage-upload.yml b/.github/workflows/coverage-upload.yml index 7953f5d..0d66a5d 100644 --- a/.github/workflows/coverage-upload.yml +++ b/.github/workflows/coverage-upload.yml @@ -9,7 +9,7 @@ permissions: checks: write # For the check run creation ! jobs: - upload: + coverage: name: Coverage permissions: contents: read diff --git a/.github/workflows/pre-check-CI-updates.yml b/.github/workflows/pre-check-CI-updates.yml index 4dde12e..1a9abcc 100644 --- a/.github/workflows/pre-check-CI-updates.yml +++ b/.github/workflows/pre-check-CI-updates.yml @@ -30,7 +30,7 @@ jobs: contents: read uses: ./.github/workflows/reusable-CI-workflow.yml - upload: + coverage: name: Coverage needs: [tests] permissions: diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index 7e0e9f2..a8bc2f7 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -222,9 +222,9 @@ jobs: needs: [ fetch-supported-versions, tests ] if: ${{ github.event_name == 'push' || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'with-nightly-tests') ) }} runs-on: ubuntu-latest - continue-on-error: true permissions: contents: read + continue-on-error: true env: COMPOSER_IGNORE_PLATFORM_REQ: 'php+' strategy: @@ -246,7 +246,7 @@ jobs: symfony-version: ${{ needs.fetch-supported-versions.outputs.symfony-next }} # Fix - behat/gherkin => Avoid issue with behat <-> gherkin packages (See https://github.com/Behat/Gherkin/issues/317) # Fix - symfony/framework-bundle - Framework bundle <7.0 require php 8.1 minimum ! - pkg-extra-constraints: behat/gherkin:~4.12.0 ${{ ( needs.fetch-supported-versions.outputs.symfony-next == '7.0' && needs.fetch-supported-versions.outputs.php-max == '8.4' ) && 'symfony/framework-bundle:~7.0.0@dev' || '' }} + pkg-extra-constraints: behat/gherkin:~4.12.0 ${{ ( needs.fetch-supported-versions.outputs.symfony-next == '7.0' && needs.fetch-supported-versions.outputs.php-max == '8.4' ) && 'symfony/framework-bundle:~7.0.0@dev' || '' }} - job-name: Symfony - With lowest supported PHP version # Fix - Sf 7.0 require php 8.1 minimum, most of deps require 8.2 ! php-version: ${{ ( needs.fetch-supported-versions.outputs.symfony-next == '7.0' && needs.fetch-supported-versions.outputs.php-min == '8.0' ) && '8.2' || needs.fetch-supported-versions.outputs.php-min }} diff --git a/.github/workflows/reusable-coverage-upload-workflow.yml b/.github/workflows/reusable-coverage-upload-workflow.yml index 9719564..a28b160 100644 --- a/.github/workflows/reusable-coverage-upload-workflow.yml +++ b/.github/workflows/reusable-coverage-upload-workflow.yml @@ -32,6 +32,8 @@ jobs: outputs: commit-sha: ${{ steps.fetch-workflow-metadata.outputs.commit-sha }} run-id: ${{ steps.fetch-workflow-metadata.outputs.run-id }} + branch: ${{ steps.fetch-workflow-metadata.outputs.branch }} + pull-request: ${{ steps.fetch-workflow-metadata.outputs.pull-request }} codacy-uploader: name: Codacy @@ -64,6 +66,6 @@ jobs: run-id: ${{ needs.fetch-info.outputs.run-id }} force-git-commit: ${{ needs.fetch-info.outputs.commit-sha }} force-git-branch: ${{ needs.fetch-info.outputs.branch }} - force-gh-pr: ${{ needs.fetch-info.outputs.pr-number }} + force-gh-pr: ${{ needs.fetch-info.outputs.pull-request }} force-uploader-build: ${{ needs.fetch-info.outputs.run-id }} force-uploader-build-url: ${{ needs.fetch-info.outputs.run-url }} diff --git a/.gitignore b/.gitignore index 934072c..4cb177e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,8 @@ build #A library must not provide a composer.lock file composer.lock -features/demo_app/var +# Demo app excluded dirs +features/demo_app/var/ #Phpunit .phpunit.result.cache diff --git a/.remarkrc b/.remarkrc index 0527df5..5bf1fca 100644 --- a/.remarkrc +++ b/.remarkrc @@ -1,6 +1,10 @@ { "plugins": [ "remark-preset-lint-consistent", - "remark-preset-lint-recommended" + "remark-preset-lint-recommended", + [ + "remark-lint-list-item-indent", + "space" + ] ] } diff --git a/.scrutinizer.yml b/.scrutinizer.yml index b579dd2..938ad6a 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -41,7 +41,6 @@ build: variables: CI: 'true' TEST_OUTPUT_STYLE: 'pretty' - COMPOSER_OPTIONS: '--optimize-autoloader' COVERAGE_OUTPUT_STYLE: 'clover' COVERAGE_CLOVER_FILE_PATH: 'build/coverage/clover.xml' PHPCS_DISABLE_WARNING: 'true' diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c4f2952..2d53c83 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -23,13 +23,13 @@ include: Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or - advances + advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic - address, without explicit permission + address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a - professional setting + professional setting ## Our Responsibilities diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f5d49ff..b1d8c8c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,33 +1,39 @@ # Contributing ## Getting Started - * Fork, then clone the repo: + +* Fork, then clone the repo: + ```bash git clone git@github.com:your-username/symfony-jsonrpc-http-server-swagger-doc.git -```` +``` + +* Make sure everything goes well: - * Make sure everything goes well: ```bash make build make test ``` - * Make your changes (Add/Update tests according to your changes). - * Make sure tests are still green: +* Make your changes (Add/Update tests according to your changes). +* Make sure tests are still green: + ```bash make test ``` - * To check code coverage, launch +* To check code coverage, launch + ```bash make coverage ``` - * Push to your fork and [submit a pull request](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc/compare/). - * Wait for feedback or merge. +* Push to your fork and [submit a pull request](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc/compare/). +* Wait for feedback or merge. + +Some stuff that will increase your pull request's acceptance: - Some stuff that will increase your pull request's acceptance: - * Write tests. - * Follow PSR-2 coding style. - * Write good commit messages. - * Do not rebase or squash your commits when a review has been made. +* Write tests. +* Follow PSR-2 coding style. +* Write good commit messages. +* Do not rebase or squash your commits when a review has been made. diff --git a/Makefile b/Makefile index fdbc8a1..0c3c84f 100644 --- a/Makefile +++ b/Makefile @@ -109,5 +109,13 @@ scrutinizer-behat: create-build-directories: mkdir -p ${PHPUNIT_COVERAGE_DIRECTORY} ${BEHAT_COVERAGE_DIRECTORY} ${REPORTS_DIRECTORY} +.PHONY: configure-dev-env +configure-dev-env: + npm install --global remark-cli remark-preset-lint-consistent remark-preset-lint-recommended remark-lint-list-item-indent + +.PHONY: lint-markdown +lint-markdown: + npx remark . --output + .PHONY: build install configure test test-unit test-functional codestyle create-build-directories scrutinizer-behat scrutinizer-phpunit .DEFAULT: build diff --git a/README.md b/README.md index ae2e317..ff8defc 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,12 @@ [![License](https://img.shields.io/github/license/yoanm/symfony-jsonrpc-http-server-swagger-doc.svg)](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc) [![Code size](https://img.shields.io/github/languages/code-size/yoanm/symfony-jsonrpc-http-server-swagger-doc.svg)](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc) -[![Dependabot Status](https://api.dependabot.com/badges/status?host=github\&repo=yoanm/symfony-jsonrpc-http-server-swagger-doc)](https://dependabot.com) +![Dependabot Status](https://flat.badgen.net/github/dependabot/yoanm/symfony-jsonrpc-http-server-swagger-doc) +![Last commit](https://badgen.net/github/last-commit/yoanm/symfony-jsonrpc-http-server-swagger-doc) [![Scrutinizer Build Status](https://img.shields.io/scrutinizer/build/g/yoanm/symfony-jsonrpc-http-server-swagger-doc.svg?label=Scrutinizer\&logo=scrutinizer)](https://scrutinizer-ci.com/g/yoanm/symfony-jsonrpc-http-server-swagger-doc/build-status/master) [![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/yoanm/symfony-jsonrpc-http-server-swagger-doc/master.svg?logo=scrutinizer)](https://scrutinizer-ci.com/g/yoanm/symfony-jsonrpc-http-server-swagger-doc/?branch=master) -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/e50269d2b7bc465fa43a9f9000bc5f06)](https://app.codacy.com/gh/yoanm/symfony-jsonrpc-http-server-swagger-doc/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/e50269d2b7bc465fa43a9f9000bc5f06)](https://app.codacy.com/gh/yoanm/symfony-jsonrpc-http-server-swagger-doc/dashboard?utm_source=gh\&utm_medium=referral\&utm_content=\&utm_campaign=Badge_grade) [![CI](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc/actions/workflows/CI.yml) [![codecov](https://codecov.io/gh/yoanm/symfony-jsonrpc-http-server-swagger-doc/branch/master/graph/badge.svg?token=NHdwEBUFK5)](https://codecov.io/gh/yoanm/symfony-jsonrpc-http-server-swagger-doc) @@ -21,8 +22,8 @@ Symfony bundle for [yoanm/jsonrpc-http-server-swagger-doc-sdk](https://github.co ## Versions -* Symfony v3/4 - PHP >=7.1 : `^v0.X` -* Symfony v4/5 - PHP >=7.2 : `^v1.0` +* Symfony v3/4 - PHP >=7.1 : `^v0.X` +* Symfony v4/5 - PHP >=7.2 : `^v1.0` ## How to use @@ -34,24 +35,24 @@ See below how to configure it. [Behat demo app configuration folders](./features/demo_app) can be used as examples. -* Add the bundles in your config/bundles.php file: - ```php - // config/bundles.php - return [ - ... - Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], - Yoanm\SymfonyJsonRpcHttpServer\JsonRpcHttpServerBundle::class => ['all' => true], - Yoanm\SymfonyJsonRpcHttpServerDoc\JsonRpcHttpServerDocBundle::class => ['all' => true], - Yoanm\SymfonyJsonRpcHttpServerSwaggerDoc\JsonRpcHttpServerSwaggerDocBundle::class => ['all' => true], - ... - ]; - ``` +* Add the bundles in your config/bundles.php file: + ```php + // config/bundles.php + return [ + ... + Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], + Yoanm\SymfonyJsonRpcHttpServer\JsonRpcHttpServerBundle::class => ['all' => true], + Yoanm\SymfonyJsonRpcHttpServerDoc\JsonRpcHttpServerDocBundle::class => ['all' => true], + Yoanm\SymfonyJsonRpcHttpServerSwaggerDoc\JsonRpcHttpServerSwaggerDocBundle::class => ['all' => true], + ... + ]; + ``` -* Configure `yoanm/symfony-jsonrpc-http-server` as described on [yoanm/symfony-jsonrpc-http-server](https://github.com/yoanm/symfony-jsonrpc-http-server) documentation. +* Configure `yoanm/symfony-jsonrpc-http-server` as described on [yoanm/symfony-jsonrpc-http-server](https://github.com/yoanm/symfony-jsonrpc-http-server) documentation. -* Configure `yoanm/symfony-jsonrpc-http-server-doc` as described on [yoanm/symfony-jsonrpc-http-server-doc](https://github.com/yoanm/symfony-jsonrpc-http-server-doc) documentation. +* Configure `yoanm/symfony-jsonrpc-http-server-doc` as described on [yoanm/symfony-jsonrpc-http-server-doc](https://github.com/yoanm/symfony-jsonrpc-http-server-doc) documentation. -* Query your project at `/doc/swagger.json` endpoint and you will have a swagger json documentation file of your server. +* Query your project at `/doc/swagger.json` endpoint and you will have a swagger json documentation file of your server. ## Event