Skip to content

Commit 803a7cb

Browse files
authored
Merge pull request #157 from yumemi-inc/GH-147
[Improve] Migrate tools and restructure project
2 parents 1f37822 + 975f6e1 commit 803a7cb

File tree

154 files changed

+141
-6931
lines changed

Some content is hidden

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

154 files changed

+141
-6931
lines changed

.dvm/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"dartSdkVersion": "3.1.0"
2+
"dartSdkVersion": "2.17.0"
33
}

.github/workflows/check-lint-auto-approve.yaml

+25-8
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,35 @@ jobs:
1515
pull-requests: write
1616
env:
1717
DIFF_FILE: diff.txt
18-
PROGRAM_DIR: tools/check_lint_rules_identity
18+
PROGRAM_DIR: tool/tools/check_lint_rules_identity
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2222
with:
23-
fetch-depth: branch
23+
fetch-depth: 0
24+
path: lint
25+
26+
- name: Generate a token
27+
id: app-token
28+
uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
29+
with:
30+
app-id: ${{ secrets.APP_ID_OF_YUMEMI_PR_TOKEN_GENERATOR }}
31+
private-key: ${{ secrets.APP_PRIVATE_KEY_OF_YUMEMI_PR_TOKEN_GENERATOR }}
32+
33+
- name: Checkout
34+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35+
with:
36+
repository: yumemi-inc/flutter-yumemi-lints-tools
37+
path: tool
2438

2539
- name: Get dvm config
26-
uses: blendfactory/dvm-config-action@v2
40+
uses: blendfactory/dvm-config-action@acdae6fda79f5a230b5424fdf40fcfd9fcd3367b # v2.0.0
2741
id: dvm-config-action
42+
with:
43+
path: "./tool/.dvm/config.json"
2844

2945
- name: Set up dart
30-
uses: dart-lang/setup-dart@v1
46+
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c # v1.7.1
3147
with:
3248
sdk: ${{ steps.dvm-config-action.outputs.dart-sdk-version }}
3349

@@ -37,16 +53,17 @@ jobs:
3753
working-directory: ${{ env.PROGRAM_DIR }}
3854

3955
- name: Create diff.txt
40-
run: git diff --name-only origin/main > ${{ env.DIFF_FILE }}
56+
run: git diff --name-only origin/main > ${{ github.workspace }}/${{ env.DIFF_FILE }}
57+
working-directory: "lint"
4158

4259
- name: Run check_lint_rules_identity
43-
run: dart run ${{ env.PROGRAM_DIR }}/bin/check_lint_rules_identity.dart ${{ env.DIFF_FILE }} packages/yumemi_lints/lib
60+
run: dart run ${{ env.PROGRAM_DIR }}/bin/check_lint_rules_identity.dart ${{ env.DIFF_FILE }} lint/lib
4461
shell: bash
4562
id: identity
4663
continue-on-error: true
4764

4865
- name: Auto approve
49-
uses: hmarr/auto-approve-action@v4
66+
uses: hmarr/auto-approve-action@8f929096a962e83ccdfa8afcf855f39f12d4dac7 # v4
5067
if: steps.identity.outcome == 'success'
5168
with:
5269
review-message: Approved. Because it is the same lint rule as the previous version.

.github/workflows/publish.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,3 @@ jobs:
1010
permissions:
1111
id-token: write # Required for authentication using OIDC
1212
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
13-
with:
14-
working-directory: packages/yumemi_lints

.github/workflows/update-lint-rules.yaml

+27-15
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,52 @@ jobs:
1313
permissions:
1414
contents: write
1515
pull-requests: write
16+
env:
17+
PROGRAM_DIR: tool/tools/update_lint_rules
1618
steps:
1719
- name: Checkout
18-
uses: actions/checkout@v4
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
with:
22+
path: lint
23+
24+
- name: Generate a token
25+
id: app-token
26+
uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
27+
with:
28+
app-id: ${{ secrets.APP_ID_OF_YUMEMI_PR_TOKEN_GENERATOR }}
29+
private-key: ${{ secrets.APP_PRIVATE_KEY_OF_YUMEMI_PR_TOKEN_GENERATOR }}
30+
31+
- name: Checkout
32+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
with:
34+
repository: yumemi-inc/flutter-yumemi-lints-tools
35+
path: tool
1936

2037
- name: Get dvm config
21-
uses: blendfactory/dvm-config-action@v2
38+
uses: blendfactory/dvm-config-action@acdae6fda79f5a230b5424fdf40fcfd9fcd3367b # v2.0.0
2239
id: dvm-config-action
40+
with:
41+
path: "./tool/.dvm/config.json"
2342

2443
- name: Set up dart
25-
uses: dart-lang/setup-dart@v1
44+
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c # v1.7.1
2645
with:
2746
sdk: ${{ steps.dvm-config-action.outputs.dart-sdk-version }}
2847

2948
- name: Install dependencies
3049
run: dart pub get
3150
shell: bash
32-
working-directory: tools/update_lint_rules
51+
working-directory: ${{ env.PROGRAM_DIR }}
3352

3453
- name: Run update_lint_rules
35-
run: dart run bin/update_lint_rules.dart "$GITHUB_WORKSPACE/packages/yumemi_lints/lib"
54+
run: dart run ${{ env.PROGRAM_DIR }}/bin/update_lint_rules.dart ${{ github.workspace }}/lint/lib
3655
shell: bash
37-
working-directory: tools/update_lint_rules
38-
39-
- name: Generate a token
40-
id: generate_token
41-
uses: actions/create-github-app-token@v1
42-
with:
43-
app-id: ${{ secrets.APP_ID_OF_YUMEMI_PR_TOKEN_GENERATOR }}
44-
private-key: ${{ secrets.APP_PRIVATE_KEY_OF_YUMEMI_PR_TOKEN_GENERATOR }}
4556

4657
- name: Create a pull request
47-
uses: peter-evans/create-pull-request@v7
58+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
4859
with:
49-
token: ${{ steps.generate_token.outputs.token }}
60+
path: lint
61+
token: ${{ steps.app-token.outputs.token }}
5062
author: 'GitHub <[email protected]>'
5163
commit-message: 'auto: Update lint rules'
5264
title: Update lint rules

.gitignore

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# https://dart.dev/guides/libraries/private-files
22
# Created by `dart pub`
3-
/.dart_tool/*
3+
/.dart_tool/
44

5-
# IntelliJ related
6-
/.idea/*
7-
!/.idea/runConfigurations/
5+
# Avoid committing pubspec.lock for library packages; see
6+
# https://dart.dev/guides/libraries/private-files#pubspeclock.
7+
/pubspec.lock
8+
/.packages
89

9-
# Melos related
10-
/pubspec_overrides.yaml
10+
/.idea/

.vscode/cspell.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"words": [
3+
"blendfactory",
4+
"dvmx",
5+
"hkusu",
6+
"hmarr",
7+
"pubspec",
8+
"yumemi",
9+
],
10+
"ignorePaths": [
11+
"README.md",
12+
"*.lock",
13+
"lib/dart/*",
14+
"lib/flutter/*",
15+
],
16+
}

.vscode/launch.json

+5-33
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,13 @@
22
"version": "0.2.0",
33
"configurations": [
44
{
5-
"name": "dev: update lint rules",
6-
"cwd": "tools/update_lint_rules",
7-
"type": "dart",
8-
"request": "launch",
9-
"program": "bin/update_lint_rules.dart"
10-
},
11-
{
12-
"name": "prod: update lint rules",
13-
"cwd": "tools/update_lint_rules",
14-
"type": "dart",
15-
"request": "launch",
16-
"program": "bin/update_lint_rules.dart",
17-
"args": ["../../packages/yumemi_lints/lib"]
18-
},
19-
{
20-
"name": "no-diff: check lint rules identity",
21-
"cwd": "tools/check_lint_rules_identity",
5+
"name": "update",
226
"request": "launch",
237
"type": "dart",
24-
"program": "bin/check_lint_rules_identity.dart",
8+
"program": "bin/yumemi_lints.dart",
259
"args": [
26-
"input_example/no_diff_version_paths.txt",
27-
"../../packages/yumemi_lints/lib"
28-
]
10+
"update",
11+
],
2912
},
30-
{
31-
"name": "has-diff: check lint rules identity",
32-
"cwd": "tools/check_lint_rules_identity",
33-
"request": "launch",
34-
"type": "dart",
35-
"program": "bin/check_lint_rules_identity.dart",
36-
"args": [
37-
"input_example/has_diff_version_paths.txt",
38-
"../../packages/yumemi_lints/lib"
39-
]
40-
}
41-
]
13+
],
4214
}

.vscode/settings.json

+13-16
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
{
22
"dart.sdkPath": ".dvm/dart_sdk",
3-
"github.copilot.enable": {
4-
"*": false,
5-
"markdown": true,
6-
"dart": true,
7-
"json": true,
8-
"yaml": true
3+
"files.insertFinalNewline": true,
4+
"files.trimFinalNewlines": true,
5+
"yaml.schemas": {
6+
"https://json.schemastore.org/github-issue-config.json": ".github/ISSUE_TEMPLATE/config.yaml",
97
},
10-
"github.copilot.editor.enableCodeActions": true,
11-
"github.copilot.editor.enableAutoCompletions": true,
12-
"cSpell.words": [
13-
"yumemi",
14-
"riverpod",
15-
"pubspec",
16-
"intellij",
17-
"todos",
18-
"googleapis",
19-
"Memoizer",
8+
"json.schemas": [
9+
{
10+
"fileMatch": [
11+
".vscode/*.json"
12+
],
13+
"schema": {
14+
"allowTrailingCommas": true,
15+
},
16+
},
2017
],
2118
}
File renamed without changes.

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
[![melos](https://img.shields.io/badge/maintained%20with-melos-f700ff.svg?style=flat-square)](https://github.com/invertase/melos)
2-
31
## Overview
42

53
Provides a set of lint rules recommended by YUMEMI Inc. for Dart and Flutter projects. These rules help enhance code quality and maintainability by ensuring adherence to best practices and style conventions. Follow the steps below to integrate and customize these lint rules into your project.
File renamed without changes.
File renamed without changes.

docs/BRANCH.md

+17-19
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
## Branches
44

5-
| Branch | Description |
6-
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
7-
| main | Production branch. |
8-
| issue/#{issue-number} | Used to work on an issue. |
9-
| feature/{name} | Used to work on feature development other than issues. |
10-
| improve/{name} | Used to work on improvements other than issues. |
11-
| fix/{name} | Used to work on bug fixes other than issues. |
12-
| release/{version} | Release branch. When merged into the main branch, a {version} tag is automatically pushed. Furthermore, when the tag is pushed, it is automatically deployed to pub.dev. |
13-
| update-contributors | Exclusively occupied by a GitHub workflow dedicated to updating the Contributors section in the README. |
14-
| auto/update-lint-rules-{short-commit-hash} | Exclusively occupied by a GitHub workflow dedicated to updating lint rules. |
15-
| dependabot/{target} | Exclusively occupied by Dependabot. |
5+
| Branch | Description |
6+
| - | - |
7+
| main | Production branch. |
8+
| GH-{issue-number} | Used to work on an issue. |
9+
| feature/{name} | Used to work on feature development other than issues. |
10+
| improve/{name} | Used to work on improvements other than issues. |
11+
| fix/{name} | Used to work on bug fixes other than issues. |
12+
| release/{version} | Release branch. When merged into the main branch, a {version} tag is automatically pushed. Furthermore, when the tag is pushed, it is automatically deployed to pub.dev. |
13+
| update-contributors | Exclusively occupied by a GitHub workflow dedicated to updating the Contributors section in the README. |
14+
| auto/update-lint-rules-{short-commit-hash} | Exclusively occupied by a GitHub workflow dedicated to updating lint rules. |
15+
| dependabot/{target} | Exclusively occupied by Dependabot. |
1616

1717
## Example
1818

@@ -21,21 +21,19 @@ gitGraph
2121
commit
2222
branch "release/2.0.0" order: 1
2323
checkout "release/2.0.0"
24-
branch "issue/#1" order: 2
24+
branch "GH-1" order: 2
2525
commit
2626
checkout "main"
2727
branch "dependabot/github_actions/peter-evans/create-pull-request-6" order: 3
2828
commit
2929
checkout "main"
3030
merge "dependabot/github_actions/peter-evans/create-pull-request-6"
3131
checkout "release/2.0.0"
32-
merge "main"
33-
checkout "issue/#1"
34-
merge "release/2.0.0"
32+
checkout "GH-1"
3533
commit
3634
checkout "release/2.0.0"
37-
merge "issue/#1"
38-
branch "issue/#2" order: 4
35+
merge "GH-1"
36+
branch "GH-2" order: 4
3937
commit
4038
commit
4139
checkout "main"
@@ -45,12 +43,12 @@ gitGraph
4543
merge "auto/update-lint-rules-1234567"
4644
checkout "release/2.0.0"
4745
merge "main"
48-
checkout "issue/#2"
46+
checkout "GH-2"
4947
merge "release/2.0.0"
5048
commit
5149
commit
5250
checkout "release/2.0.0"
53-
merge "issue/#2"
51+
merge "GH-2"
5452
checkout "main"
5553
merge "release/2.0.0"
5654
branch "update-contributors" order: 6

docs/COPILOT.md

-34
This file was deleted.

docs/contributing/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In general, we welcome contributions in the following areas 🙌:
44

5-
- Improvements to `tools/update_lint_rules`
5+
- Improvements to `lib/src` and `test` directories
66
- Other minor enhancements
77

88
If your contribution doesn't fall into these categories, please feel free to discuss it in the [Discussions] section.

0 commit comments

Comments
 (0)