diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml new file mode 100644 index 0000000..d146762 --- /dev/null +++ b/.github/workflows/linting.yaml @@ -0,0 +1,24 @@ +name: Linting + +# This action works with pull requests and pushes +on: [push, pull_request] + +jobs: + prettier: + runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + + - name: Install dependencies + run: npm install + + - name: Validate JSONC files + run: npm run lint diff --git a/.github/workflows/validate-jsonc.yaml b/.github/workflows/validate-jsonc.yaml index bc151aa..cc9125c 100644 --- a/.github/workflows/validate-jsonc.yaml +++ b/.github/workflows/validate-jsonc.yaml @@ -5,6 +5,9 @@ on: [push, pull_request] jobs: validate-jsonc: runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true steps: - name: Checkout code diff --git a/.gitignore b/.gitignore index 897f3b1..07e6e47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ /node_modules -/package-lock.json -/package.json diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..6648aad --- /dev/null +++ b/.prettierrc @@ -0,0 +1,12 @@ +{ + "arrowParens": "avoid", + "bracketSpacing": true, + "endOfLine": "lf", + "jsxSingleQuote": false, + "printWidth": 80, + "semi": true, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "all", + "useTabs": false +} diff --git a/README.md b/README.md index ebaf0ba..601b594 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,23 @@ This repository contains the DDEV remote config definitions used by DDEV. For more information, see [DDEV's documentation](https://ddev.readthedocs.io/en/latest/developers/remote-config). + +## Contributing + +### Style Guide + +This repository uses [Prettier](https://prettier.io/docs/en/) to maintain consistent formatting. +You can manually run Prettier on this repository (requires Node.js). + +1. Clone or fork this project locally. +2. Install node dependencies: + + ```shell + npm install + ``` + +3. Run the following command to attempt to auto-fix issues: + + ```shell + npm run lint:fix + ``` diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..256bb0e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,27 @@ +{ + "name": "remote-config", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "devDependencies": { + "prettier": "^3.0.3" + } + }, + "node_modules/prettier": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..8e49109 --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "scripts": { + "lint": "./node_modules/.bin/prettier remote-config.jsonc --check", + "lint:fix": "npm run lint -- --write" + }, + "devDependencies": { + "prettier": "^3.0.3" + } +} diff --git a/remote-config.jsonc b/remote-config.jsonc index c4be88c..60ac2db 100644 --- a/remote-config.jsonc +++ b/remote-config.jsonc @@ -1,130 +1,130 @@ { - // Update interval of the remote config in hours. - "update-interval": 10, - // Messages shown to the user. - "messages": { - // Infos and warnings are shown on almost every ddev command and can - // not be disabled by the user, please use with caution! -// "notifications": { -// "interval": 20, -// "infos": [ -// { -// "message": "If you have warnings about omit_containers: [dba] try `grep \"^omit_containers.*dba\" */.ddev/config.yaml` in the directory where you keep your projects" -// } -// ], -// "warnings": [] -// }, - // Ticker messages are are shown once in an interval and are rotated - // once a message was shown. - "ticker": { - "interval": 20, - "messages": [ - { - "message": "Join the DDEV Discord to support others and get support: https://discord.gg/hCZFfAMc5k" - }, - { - "message": "Contributor training every Tuesday, sign up! https://ddev.com/blog/contributor-training/" - }, - { - "message": "A 403 from your project may mean the docroot is not specified or `index.php` is missing." - }, - { - "message": "You can have as many databases as you want! https://ddev.readthedocs.io/en/latest/users/usage/faq/#can-i-use-additional-databases-with-ddev" - }, - { - "message": "Use `ddev describe` to get a summary of your project’s configuration." - }, - { - "message": "Don’t forget to read the docs! https://ddev.readthedocs.io/" - }, - { - "message": "DDEV needs *you* as a financial sponsor! https://github.com/sponsors/ddev" - }, - { - "message": "Use `ddev exec` to run commands in your web container." - }, - { - "message": "`ddev snapshot` is great to get a quick copy of your database. `ddev help snapshot`" - }, - { - "message": "Try `ddev share` so collaborators anywhere can see your current project. https://ddev.readthedocs.io/en/latest/users/topics/sharing/" - }, - { - "message": "`ddev poweroff` is a great way to get back to the beginning and save resources." - }, - { - "message": "`ddev delete` deletes your database and project registration; it doesn't delete any code or configuration. `ddev help delete`" - }, - { - "message": "`ddev delete images` will save you some disk space by removing all ddev/ddev-* Docker images not in use by the current version of DDEV." - }, - { - "message": "Different projects can communicate with each other! https://ddev.readthedocs.io/en/latest/users/usage/faq/#can-different-projects-communicate-with-each-other" - }, - { - "message": "The FAQ is a useful collection of not-obvious details: https://ddev.readthedocs.io/en/latest/users/usage/faq" - }, - { - "message": "Platform.sh sponsors DDEV by paying its lead maintainer to work on DDEV full time!" - }, - { - "message": "Need to get the database and files from your Platform.sh stack? Try `ddev pull platform`! https://ddev.readthedocs.io/en/latest/users/providers/platform" - }, - { - "message": "Use `ddev composer` instead of `composer` to ensure your project uses the Composer and PHP versions it specifies." - }, - { - "message": "`ddev npm` is the right way to run npm commands in your web container." - }, - { - "message": "`ddev yarn` is a great way to run yarn commands in your web container." - }, - { - "message": "`ddev snapshot -a` will back up all your project databases." - }, - { - "message": "You're invited to the DDEV Advisory Group, bimonthly on first Wednesday" - }, - { - "message": "Sign up for the DDEV newsletter! https://ddev.com/newsletter/" - }, - { - "message": "If you miss phpMyAdmin in DDEV, run `ddev get ddev/ddev-phpmyadmin`" - }, - { - "message": "MacStadium supports DDEV with an M1 Mac Mini that runs macOS tests." - }, - { - "message": "You can turn off the cell borders in `ddev describe` and `ddev list` by running `ddev config global --simple-formatting`." - }, - { - "message": "You can use a more lively `ddev list` and `ddev describe` output by running `ddev config global --table-style=bright`. Try it!" - }, - { - "message": "DDEV's fiscal entity is now the DDEV Foundation. We have a real focus on the long-term sustainability of the project, not just depending on Randy. https://ddev.com/foundation" - }, - { - "message": "Tag1 Consulting has become a major sponsor of DDEV with $1K/month! Stop by and thank them at https://tag1.com." - }, - { - "message": "DDEV’s latest releases include PHP 8.3. We hope to have all extensions by the time 8.3 reaches general availability later this year." - }, - { - "message": "Lots of database browsers work with DDEV, including TablePlus, Sequel Pro, and DBeaver. https://ddev.readthedocs.io/en/latest/users/usage/database-management/#database-guis" - }, - { - "message": "View officially-supported add-ons by running `ddev get --list`, or include third-party add-ons with `ddev get --list --all`" - }, - { - "message": "VS Code users: have you tried the new DDEV VS Code extension? https://marketplace.visualstudio.com/items?itemName=biati.ddev-manager" - }, - { - "message": "PhpStorm users: you'll love the DDEV Integration Plugin for PhpStorm! https://plugins.jetbrains.com/plugin/18813-ddev-integration" - }, - { - "message": "Did you know you can set environment variables with the `.ddev/.env` file?" - } - ] - } - } + // Update interval of the remote config in hours. + "update-interval": 10, + // Messages shown to the user. + "messages": { + // Infos and warnings are shown on almost every ddev command and can + // not be disabled by the user, please use with caution! + // "notifications": { + // "interval": 20, + // "infos": [ + // { + // "message": "If you have warnings about omit_containers: [dba] try `grep \"^omit_containers.*dba\" */.ddev/config.yaml` in the directory where you keep your projects" + // } + // ], + // "warnings": [] + // }, + // Ticker messages are shown once in an interval and are rotated + // once a message was shown. + "ticker": { + "interval": 20, + "messages": [ + { + "message": "Join the DDEV Discord to support others and get support: https://discord.gg/hCZFfAMc5k" + }, + { + "message": "Contributor training every Tuesday, sign up! https://ddev.com/blog/contributor-training/" + }, + { + "message": "A 403 from your project may mean the docroot is not specified or `index.php` is missing." + }, + { + "message": "You can have as many databases as you want! https://ddev.readthedocs.io/en/latest/users/usage/faq/#can-i-use-additional-databases-with-ddev" + }, + { + "message": "Use `ddev describe` to get a summary of your project’s configuration." + }, + { + "message": "Don’t forget to read the docs! https://ddev.readthedocs.io/" + }, + { + "message": "DDEV needs *you* as a financial sponsor! https://github.com/sponsors/ddev" + }, + { + "message": "Use `ddev exec` to run commands in your web container." + }, + { + "message": "`ddev snapshot` is great to get a quick copy of your database. `ddev help snapshot`" + }, + { + "message": "Try `ddev share` so collaborators anywhere can see your current project. https://ddev.readthedocs.io/en/latest/users/topics/sharing/" + }, + { + "message": "`ddev poweroff` is a great way to get back to the beginning and save resources." + }, + { + "message": "`ddev delete` deletes your database and project registration; it doesn't delete any code or configuration. `ddev help delete`" + }, + { + "message": "`ddev delete images` will save you some disk space by removing all ddev/ddev-* Docker images not in use by the current version of DDEV." + }, + { + "message": "Different projects can communicate with each other! https://ddev.readthedocs.io/en/latest/users/usage/faq/#can-different-projects-communicate-with-each-other" + }, + { + "message": "The FAQ is a useful collection of not-obvious details: https://ddev.readthedocs.io/en/latest/users/usage/faq" + }, + { + "message": "Platform.sh sponsors DDEV by paying its lead maintainer to work on DDEV full time!" + }, + { + "message": "Need to get the database and files from your Platform.sh stack? Try `ddev pull platform`! https://ddev.readthedocs.io/en/latest/users/providers/platform" + }, + { + "message": "Use `ddev composer` instead of `composer` to ensure your project uses the Composer and PHP versions it specifies." + }, + { + "message": "`ddev npm` is the right way to run npm commands in your web container." + }, + { + "message": "`ddev yarn` is a great way to run yarn commands in your web container." + }, + { + "message": "`ddev snapshot -a` will back up all your project databases." + }, + { + "message": "You're invited to the DDEV Advisory Group, bimonthly on first Wednesday" + }, + { + "message": "Sign up for the DDEV newsletter! https://ddev.com/newsletter/" + }, + { + "message": "If you miss phpMyAdmin in DDEV, run `ddev get ddev/ddev-phpmyadmin`" + }, + { + "message": "MacStadium supports DDEV with an M1 Mac Mini that runs macOS tests." + }, + { + "message": "You can turn off the cell borders in `ddev describe` and `ddev list` by running `ddev config global --simple-formatting`." + }, + { + "message": "You can use a more lively `ddev list` and `ddev describe` output by running `ddev config global --table-style=bright`. Try it!" + }, + { + "message": "DDEV's fiscal entity is now the DDEV Foundation. We have a real focus on the long-term sustainability of the project, not just depending on Randy. https://ddev.com/foundation" + }, + { + "message": "Tag1 Consulting has become a major sponsor of DDEV with $1K/month! Stop by and thank them at https://tag1.com." + }, + { + "message": "DDEV’s latest releases include PHP 8.3. We hope to have all extensions by the time 8.3 reaches general availability later this year." + }, + { + "message": "Lots of database browsers work with DDEV, including TablePlus, Sequel Pro, and DBeaver. https://ddev.readthedocs.io/en/latest/users/usage/database-management/#database-guis" + }, + { + "message": "View officially-supported add-ons by running `ddev get --list`, or include third-party add-ons with `ddev get --list --all`" + }, + { + "message": "VS Code users: have you tried the new DDEV VS Code extension? https://marketplace.visualstudio.com/items?itemName=biati.ddev-manager" + }, + { + "message": "PhpStorm users: you'll love the DDEV Integration Plugin for PhpStorm! https://plugins.jetbrains.com/plugin/18813-ddev-integration" + }, + { + "message": "Did you know you can set environment variables with the `.ddev/.env` file?" + } + ] + } + } }