Skip to content

Commit

Permalink
Integrate dprint (#871)
Browse files Browse the repository at this point in the history
ref: #866, #869

This configuration is not my preference. It keeps zero configration as possible we can.
Because I respect the pankona wish as he said as mobu-of-the-world/mobu#489 (comment).

---

Ignore files around gitbook

Because some of them are generated by tools.
And we may drop gitbook dependency. See #870
  • Loading branch information
kachick committed Jun 21, 2023
1 parent a5f7214 commit 6b58947
Show file tree
Hide file tree
Showing 20 changed files with 209 additions and 181 deletions.
60 changes: 30 additions & 30 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- automerge
- package-ecosystem: npm
directory: "/hashira-web"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- automerge
ignore:
- dependency-name: '@types/node'
update-types: ['version-update:semver-major']
- package-ecosystem: gomod
directory: "/hashira-web/functions"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- automerge
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
labels:
- automerge
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- automerge
- package-ecosystem: npm
directory: "/hashira-web"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- automerge
ignore:
- dependency-name: "@types/node"
update-types: ["version-update:semver-major"]
- package-ecosystem: gomod
directory: "/hashira-web/functions"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- automerge
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- automerge
13 changes: 13 additions & 0 deletions .github/workflows/dprint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: dprint
on:
push:
branches: [master]
pull_request:

jobs:
check:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dprint/check@v2.2
4 changes: 2 additions & 2 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
entryPoint: hashira-web
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_HASHIRA_WEB }}'
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_HASHIRA_WEB }}"
channelId: live
projectId: hashira-web
8 changes: 4 additions & 4 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
pull_request:
types: [opened, synchronize, reopened, labeled]
paths:
- '.github/workflows/firebase-hosting-pull-request.yml'
- 'hashira-web/**'
- ".github/workflows/firebase-hosting-pull-request.yml"
- "hashira-web/**"

defaults:
run:
Expand All @@ -30,6 +30,6 @@ jobs:
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
entryPoint: hashira-web
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_HASHIRA_WEB }}'
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_HASHIRA_WEB }}"
projectId: hashira-web
6 changes: 3 additions & 3 deletions .github/workflows/hashira-cui--release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: hashira-cui - release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -14,8 +14,8 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
go-version-file: "go.mod"
cache-dependency-path: "go.sum"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/hashira-cui--test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,37 @@ name: hashira-cui - CI
on:
pull_request:
paths:
- '**'
- '!hashira-web/**'
- '!.github/workflows/**'
- '.github/workflows/hashira-cui--test.yml'
- "**"
- "!hashira-web/**"
- "!.github/workflows/**"
- ".github/workflows/hashira-cui--test.yml"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
go-version-file: "go.mod"
cache-dependency-path: "go.sum"
- run: make
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
go-version-file: "go.mod"
cache-dependency-path: "go.sum"
- run: make test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
go-version-file: "go.mod"
cache-dependency-path: "go.sum"
- uses: golangci/golangci-lint-action@v3
with:
version: v1.53.3

2 changes: 1 addition & 1 deletion .github/workflows/hashira-web--test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- ".github/workflows/hashira-web--test.yml"
- "hashira-web/**"
- '!hashira-web/functions/**'
- "!hashira-web/functions/**"

defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hashira-web-functions--test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'hashira-web/functions/go.mod'
cache-dependency-path: 'hashira-web/functions/go.sum'
go-version-file: "hashira-web/functions/go.mod"
cache-dependency-path: "hashira-web/functions/go.sum"
- run: go test ./...
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ update-dependencies:
cd $(CURDIR)/cmd/hashira-web-client && $(UPDATE_DEPENDENCIES_CMD)

lint:
dprint check
golangci-lint run ./...

test:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# hashira

Application to manage **today's** tasks. Establish a Hashira for the day.
Application to manage **today's** tasks. Establish a Hashira for the day.\
design documents are available at [here](https://pankona.github.io/hashira/)

hashira on web is available here (alpha version) https://hashira-web.web.app
Expand Down
23 changes: 23 additions & 0 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"typescript": {
},
"json": {
},
"markdown": {
},
"prettier": {
},
"includes": ["**/*.{ts,tsx,js,jsx,cjs,mjs,json,md,html,css,yml}"],
"excludes": [
"**/node_modules",
"**/*-lock.json",
"docs",
"docsrc"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.85.0.wasm",
"https://plugins.dprint.dev/json-0.17.4.wasm",
"https://plugins.dprint.dev/markdown-0.15.3.wasm",
"https://plugins.dprint.dev/prettier-0.24.0.json@9a57d0d8e440ad90d07a503166af47e7a6a886abd46767933f9c279f72468596"
]
}
4 changes: 1 addition & 3 deletions hashira-web/src/AccessToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ const AccessToken: React.FC<{ user: firebase.User | null | undefined }> = ({
return (
<div>
<Header user={user} />
{!user || !accesstokens ? (
<div>Loading...</div>
) : (
{!user || !accesstokens ? <div>Loading...</div> : (
<>
<button
onClick={async () => {
Expand Down

0 comments on commit 6b58947

Please sign in to comment.