-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reformat everything with Prettier. (#222)
### What We seem to be going back and forth on formatting, especially for JavaScript. Let's stop doing that and just use an auto-formatter for JavaScript, JSON, YAML, and Markdown. This replaces the `jq`-based formatting for the goldenfiles; the results seem to be identical. We ignore `flake.lock` because it is machine-generated and auto-formatting it differently from `nix flake update` will cause unnecessary grief. ### How `just format` now runs `prettier --write .`, which reformats JavaScript, JSON, YAML, and Markdown, ignoring all files in `.gitignore` or `.prettierignore`. I have added `flake.lock` to `.prettierignore` to ensure we don't thrash between two formats. `just format-check` will now run `prettier --check .`. I have run `just format` to ensure that everything is formatted consistently. We can change this by configuring Prettier with a `.prettierrc` file if we don't like the current formatting.
- Loading branch information
1 parent
20dfcdf
commit 92cd94c
Showing
33 changed files
with
335 additions
and
580 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,4 @@ steps: | |
- url: [email protected]:hasura/ddn-cloud.git | ||
ref: staging | ||
delete_checkout: true | ||
interpolate_checkout_path: "$BUILDKITE_BUILD_CHECKOUT_PATH/$BUILDKITE_BUILD_ID/$BUILDKITE_JOB_ID" | ||
interpolate_checkout_path: "$BUILDKITE_BUILD_CHECKOUT_PATH/$BUILDKITE_BUILD_ID/$BUILDKITE_JOB_ID" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Postgres NDC format | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
cargo-fmt: | ||
name: check formatting with cargo fmt | ||
runs-on: ubuntu-latest | ||
env: | ||
CARGO_NET_GIT_FETCH_WITH_CLI: "true" | ||
RUSTFLAGS: "-D warnings" # fail on warnings | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: install tools | ||
run: | | ||
rustup show | ||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: check Rust formatting | ||
run: | | ||
cargo fmt --all | ||
# scream into Slack if something goes wrong | ||
- name: Report Status | ||
if: github.ref == 'refs/heads/main' | ||
uses: ravsamhq/notify-slack-action@v2 | ||
with: | ||
status: ${{ job.status }} | ||
notify_when: failure | ||
notification_title: "😧 Error on <{repo_url}|{repo}>" | ||
message_format: "🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>" | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }} | ||
|
||
prettier: | ||
name: check formatting with prettier | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: DeterminateSystems/nix-installer-action@v4 | ||
|
||
- uses: DeterminateSystems/magic-nix-cache-action@v2 | ||
|
||
- name: check other formatting | ||
run: | | ||
nix develop --command prettier --check . | ||
# scream into Slack if something goes wrong | ||
- name: Report Status | ||
if: github.ref == 'refs/heads/main' | ||
uses: ravsamhq/notify-slack-action@v2 | ||
with: | ||
status: ${{ job.status }} | ||
notify_when: failure | ||
notification_title: "😧 Error on <{repo_url}|{repo}>" | ||
message_format: "🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>" | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ jobs: | |
- name: Test | ||
uses: cygnetdigital/[email protected] | ||
with: | ||
url: 'http://localhost:9100/' | ||
responseCode: '200' | ||
url: "http://localhost:9100/" | ||
responseCode: "200" | ||
timeout: 2000 | ||
interval: 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
flake.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.