From 1ba0d9ea9478b42175fd8f76523f6819e664044a Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Sun, 7 Aug 2022 09:13:57 -0400 Subject: [PATCH 1/4] lint file names --- .github/workflows/lint.yml | 16 ++++++++++++++++ docker-compose.yml | 3 ++- package.json | 3 ++- tools/linter/file-name.sh | 18 ++++++++++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100755 tools/linter/file-name.sh diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..770d7e5 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,16 @@ +name: Lint + +on: + pull_request: + paths: + - '**' + - '!docs/**' + - '!**/*.md' + branches: + - master +jobs: + build-php: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: npm run lint \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 29fa686..f54337c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,4 @@ -version : '3' +--- +version: '3' services: {} diff --git a/package.json b/package.json index b42fca8..30eb883 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ }, "private": true, "scripts": { - "release": "standard-version --sign" + "release": "standard-version --sign", + "lint": "./tools/linter/file-name.sh" }, "repository": { "type": "git", diff --git a/tools/linter/file-name.sh b/tools/linter/file-name.sh new file mode 100755 index 0000000..e3206a7 --- /dev/null +++ b/tools/linter/file-name.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e; + +echo "Linting file names, only allowing .yml"; + +paths=`git ls-files | grep .yaml`; + +count=`echo $paths | wc -w`; + +if [ $count != 0 ] + echo "$count file(s) discovered"; + for item in $paths; do + echo $item; + done; + exit 255; +then + exit 1; +fi \ No newline at end of file From 7ec07d288dc8277e58e70d4de9ed0956441b87f2 Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Sun, 7 Aug 2022 09:17:24 -0400 Subject: [PATCH 2/4] fix exit codes --- tools/linter/file-name.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/linter/file-name.sh b/tools/linter/file-name.sh index e3206a7..887fe98 100755 --- a/tools/linter/file-name.sh +++ b/tools/linter/file-name.sh @@ -12,7 +12,7 @@ if [ $count != 0 ] for item in $paths; do echo $item; done; - exit 255; -then exit 1; +then + exit 0; fi \ No newline at end of file From 84a57a63d64a62cbd019cdd48721e034057a1020 Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Sun, 7 Aug 2022 09:20:18 -0400 Subject: [PATCH 3/4] move to yml --- compose/base/2.4.yml | 2 +- compose/mailhog/{1.0.yaml => 1.0.yml} | 0 compose/php/7.2/{7.2-xdebug.yaml => 7.2-xdebug.yml} | 0 compose/php/7.2/{7.2.yaml => 7.2.yml} | 0 compose/php/7.3/{7.3-xdebug.yaml => 7.3-xdebug.yml} | 0 compose/php/7.3/{7.3.yaml => 7.3.yml} | 0 compose/php/7.4/{7.4-xdebug.yaml => 7.4-xdebug.yml} | 0 compose/php/7.4/{7.4.yaml => 7.4.yml} | 0 docs/stories/debugging/README.md | 2 +- docs/stories/docker/mailhog-service.md | 2 +- 10 files changed, 3 insertions(+), 3 deletions(-) rename compose/mailhog/{1.0.yaml => 1.0.yml} (100%) rename compose/php/7.2/{7.2-xdebug.yaml => 7.2-xdebug.yml} (100%) rename compose/php/7.2/{7.2.yaml => 7.2.yml} (100%) rename compose/php/7.3/{7.3-xdebug.yaml => 7.3-xdebug.yml} (100%) rename compose/php/7.3/{7.3.yaml => 7.3.yml} (100%) rename compose/php/7.4/{7.4-xdebug.yaml => 7.4-xdebug.yml} (100%) rename compose/php/7.4/{7.4.yaml => 7.4.yml} (100%) diff --git a/compose/base/2.4.yml b/compose/base/2.4.yml index 4a7f8c8..a43f33c 100644 --- a/compose/base/2.4.yml +++ b/compose/base/2.4.yml @@ -60,7 +60,7 @@ services: memory: 2G mailhog: extends: - file: ./compose/mailhog/1.0.yaml + file: ./compose/mailhog/1.0.yml service: mailhog networks: - backend diff --git a/compose/mailhog/1.0.yaml b/compose/mailhog/1.0.yml similarity index 100% rename from compose/mailhog/1.0.yaml rename to compose/mailhog/1.0.yml diff --git a/compose/php/7.2/7.2-xdebug.yaml b/compose/php/7.2/7.2-xdebug.yml similarity index 100% rename from compose/php/7.2/7.2-xdebug.yaml rename to compose/php/7.2/7.2-xdebug.yml diff --git a/compose/php/7.2/7.2.yaml b/compose/php/7.2/7.2.yml similarity index 100% rename from compose/php/7.2/7.2.yaml rename to compose/php/7.2/7.2.yml diff --git a/compose/php/7.3/7.3-xdebug.yaml b/compose/php/7.3/7.3-xdebug.yml similarity index 100% rename from compose/php/7.3/7.3-xdebug.yaml rename to compose/php/7.3/7.3-xdebug.yml diff --git a/compose/php/7.3/7.3.yaml b/compose/php/7.3/7.3.yml similarity index 100% rename from compose/php/7.3/7.3.yaml rename to compose/php/7.3/7.3.yml diff --git a/compose/php/7.4/7.4-xdebug.yaml b/compose/php/7.4/7.4-xdebug.yml similarity index 100% rename from compose/php/7.4/7.4-xdebug.yaml rename to compose/php/7.4/7.4-xdebug.yml diff --git a/compose/php/7.4/7.4.yaml b/compose/php/7.4/7.4.yml similarity index 100% rename from compose/php/7.4/7.4.yaml rename to compose/php/7.4/7.4.yml diff --git a/docs/stories/debugging/README.md b/docs/stories/debugging/README.md index 458fd06..3dc0f55 100644 --- a/docs/stories/debugging/README.md +++ b/docs/stories/debugging/README.md @@ -11,7 +11,7 @@ This tutorial will help you set up a debugger for your local Mage2docker environ ## Usage -1. To use xdebug with Mage2docker, simply open your `.env` and append `:compose/php/7.3/7.3-xdebug.yaml` to your `COMPOSE_FILE` key. +1. To use xdebug with Mage2docker, simply open your `.env` and append `:compose/php/7.3/7.3-xdebug.yml` to your `COMPOSE_FILE` key. > Replace the php version with the supported php version of your choice. diff --git a/docs/stories/docker/mailhog-service.md b/docs/stories/docker/mailhog-service.md index d45cba9..27e932f 100644 --- a/docs/stories/docker/mailhog-service.md +++ b/docs/stories/docker/mailhog-service.md @@ -1,2 +1,2 @@ # Mailhog service -For development environments, the service mailhog helps to test emails locally, it's declared in the [docker-compose](../../../compose/mailhog/1.0.yaml) and exports two ports, the first one is 1025 that it's used for smtp server, and the 8025 is a web interface. \ No newline at end of file +For development environments, the service mailhog helps to test emails locally, it's declared in the [docker-compose](../../../compose/mailhog/1.0.yml) and exports two ports, the first one is 1025 that it's used for smtp server, and the 8025 is a web interface. \ No newline at end of file From 9633d13665d61cd7bb2deb266d18ced2122cdc38 Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Sun, 7 Aug 2022 09:29:26 -0400 Subject: [PATCH 4/4] i cant write bash --- tools/linter/file-name.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/linter/file-name.sh b/tools/linter/file-name.sh index 887fe98..a8d0da6 100755 --- a/tools/linter/file-name.sh +++ b/tools/linter/file-name.sh @@ -1,18 +1,15 @@ #!/bin/bash set -e; -echo "Linting file names, only allowing .yml"; - -paths=`git ls-files | grep .yaml`; - +paths=`git ls-files | grep .yaml || true`; count=`echo $paths | wc -w`; -if [ $count != 0 ] +if [ "$count" != "0" ]; then echo "$count file(s) discovered"; for item in $paths; do echo $item; done; exit 1; -then +else exit 0; fi \ No newline at end of file