Browse Source

Merge pull request #468 from provokateurin/feature/conventional-commits

Use conventional commits
pull/477/head
Kate 1 year ago committed by GitHub
parent
commit
88d07c1164
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      .github/workflows/conventional_commits.yaml
  2. 5
      .husky/commit-msg
  3. 24
      commitlint.yaml
  4. 2
      pubspec.yaml
  5. 1
      tool/setup.sh

22
.github/workflows/conventional_commits.yaml

@ -0,0 +1,22 @@
name: Conventional commits
on:
pull_request:
jobs:
conventional-commits:
name: Conventional commits
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Install dart
uses: dart-lang/setup-dart@v1
- name: Install commitlint_cli
run: dart pub get
- name: Lint conventional commits
run: dart run commitlint_cli --from="origin/${{ github.base_ref }}" --to="${{ github.head_ref }}"

5
.husky/commit-msg

@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# https://github.com/hyiso/commitlint/issues/6
sed "s/^fixup! //" < "$1" | dart run commitlint_cli

24
commitlint.yaml

@ -0,0 +1,24 @@
include: package:commitlint_cli/commitlint.yaml
rules:
scope-empty:
- 2
- never
scope-enum:
- 2
- always
- - ci
- deps
- docs
- tool
- app
- dynamite
- dynamite_runtime
- file_icons
- neon
- neon_files
- neon_news
- neon_notes
- neon_notifications
- nextcloud
- sort_box

2
pubspec.yaml

@ -4,5 +4,7 @@ publish_to: none
environment: environment:
sdk: '>=3.0.0 <4.0.0' sdk: '>=3.0.0 <4.0.0'
dev_dependencies: dev_dependencies:
commitlint_cli: ^0.4.1
fvm: ^2.4.1 fvm: ^2.4.1
husky: ^0.1.6
melos: ^3.1.0 melos: ^3.1.0

1
tool/setup.sh

@ -6,3 +6,4 @@ dart pub global activate melos 3.1.0
dart pub global activate fvm 2.4.1 dart pub global activate fvm 2.4.1
echo "y" | fvm install echo "y" | fvm install
melos exec --concurrency=1 flutter pub get melos exec --concurrency=1 flutter pub get
dart run husky install

Loading…
Cancel
Save