Skip to content

Commit

Permalink
Lint document and add linting step (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler36 committed Oct 27, 2023
1 parent 0eaf1b9 commit 5873500
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 130 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .github/workflows/validate-jsonc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
/node_modules
/package-lock.json
/package.json
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"endOfLine": "lf",
"jsxSingleQuote": false,
"printWidth": 80,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
256 changes: 128 additions & 128 deletions remote-config.jsonc
Original file line number Diff line number Diff line change
@@ -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?"
}
]
}
}
}

0 comments on commit 5873500

Please sign in to comment.