Skip to content

Commit 162d4b1

Browse files
authored
chore: Update project code styles (#353)
* chore: use .tool-versions * chore: refactoring melos.yaml * chore: update dependencies for example * chore: add prettier * chore: add lint-staged * chore: add autoassign * chore: add CODEOWNER * docs: update how to use melos * chore: enabled flutter cache
1 parent 98d8617 commit 162d4b1

File tree

63 files changed

+12830
-648
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+12830
-648
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @wasabeef

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Bug Report
22
description: File a bug report
3-
title: "[BUG]: "
4-
labels: ["bug"]
3+
title: '[BUG]: '
4+
labels: ['bug']
55
body:
66
- type: markdown
77
attributes:
@@ -39,7 +39,7 @@ body:
3939
label: What happened?
4040
description: Also tell us, what did you expect to happen?
4141
placeholder: Tell us what you see!
42-
value: "A bug happened!"
42+
value: 'A bug happened!'
4343
validations:
4444
required: true
4545
- type: textarea

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Feature Request
22
description: File a feature request
3-
title: "[FR]: "
4-
labels: ["enhancement"]
3+
title: '[FR]: '
4+
labels: ['enhancement']
55
body:
66
- type: markdown
77
attributes:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Please delete options that are not relevant.
1616
## Checklist:
1717

1818
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
19+
1920
- [ ] Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
2021
- [ ] Ensure the tests (`melos run unit:test`)
2122
- [ ] Ensure the analyzer and formatter pass (`melos run format` to automatically apply formatting)

.github/workflows/autoassign.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Auto self assign
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
jobs:
8+
assign:
9+
if: |
10+
github.event.pull_request.user.type == 'User'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/github-script@v6
14+
with:
15+
script: |
16+
const assignees = context.payload.pull_request.assignees
17+
if (!assignees || assignees.length === 0) {
18+
github.rest.issues.addAssignees({
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
issue_number: context.issue.number,
22+
assignees: `${{ github.actor }}`,
23+
})
24+
}

.github/workflows/build.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [opened, synchronize]
66
push:
77
branches:
8-
- "main"
8+
- 'main'
99

1010
jobs:
1111
build:
@@ -16,12 +16,16 @@ jobs:
1616
os: [ubuntu-latest, windows-latest, macos-latest]
1717
steps:
1818
- uses: actions/checkout@v3
19+
- uses: wasabeef/[email protected]
20+
id: asdf
1921
- uses: subosito/flutter-action@v2
2022
with:
23+
flutter-version: ${{ steps.asdf.outputs.flutter }}
2124
channel: stable
25+
cache: true
2226
- uses: dart-lang/setup-dart@v1
2327
with:
24-
sdk: stable
28+
sdk: ${{ steps.asdf.outputs.dart }}
2529

2630
- name: Set environment
2731
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
@@ -48,12 +52,12 @@ jobs:
4852
- name: Run tests for our dart project.
4953
if: startsWith(matrix.os, 'ubuntu')
5054
run: |
51-
melos run test
55+
melos test
5256
5357
- name: Run coverage
5458
if: startsWith(matrix.os, 'ubuntu')
5559
run: |
56-
melos run coverage
60+
melos coverage
5761
5862
- uses: codecov/codecov-action@v3
5963
with:
@@ -62,10 +66,10 @@ jobs:
6266

6367
- name: Generate example
6468
run: |
65-
melos run example:command
66-
melos run example:build_runner
69+
melos gen:example:command
70+
melos gen:example:build_runner
6771
6872
- name: Check for any formatting and statically analyze the code.
6973
run: |
70-
melos run format
71-
melos run analyze
74+
melos format
75+
melos analyze

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- "v*.*.*"
6+
- 'v*.*.*'
77

88
jobs:
99
build:
@@ -23,12 +23,16 @@ jobs:
2323

2424
steps:
2525
- uses: actions/checkout@v3
26+
- uses: wasabeef/[email protected]
27+
id: asdf
2628
- uses: subosito/flutter-action@v2
2729
with:
30+
flutter-version: ${{ steps.asdf.outputs.flutter }}
2831
channel: stable
32+
cache: true
2933
- uses: dart-lang/setup-dart@v1
3034
with:
31-
sdk: stable
35+
sdk: ${{ steps.asdf.outputs.dart }}
3236

3337
- name: Set environment
3438
run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
pnpm lint-staged --allow-empty

.husky/pre-push

Lines changed: 0 additions & 4 deletions
This file was deleted.

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
19.4.0

0 commit comments

Comments
 (0)