Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(workflow): husky cannot use [[ ]] test stynax on WSL2-Ubuntu #23

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.husky/** linguist-generated
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Hi! We're Really excited that you are interested in contributing to Furigana Mak
- Commit messages must be matched by the following regex:

```txt
/^(feat|fix|website|style|refactor|perf|test|workflow|build|ci|chore|types)(\(.+\))?: .{1,50}/
/^(feat|fix|website|style|refactor|perf|test|build|ci|chore|types|workflow)(\(.+\))?: .{1,50}/
```

## Development Setup
Expand Down
7 changes: 3 additions & 4 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#!/usr/bin/env bash
. "$(dirname -- "$0")/_/husky.sh"

message="$(cat $1)"
requiredPattern="^(feat|fix|website|style|refactor|perf|test|workflow|build|ci|chore|types)(\(.+\))?: .{1,50}"
if ! [[ $message =~ $requiredPattern ]]; then
requiredPattern="^(feat|fix|website|style|refactor|perf|test|build|ci|chore|types|workflow)(\(.+\))?: .{1,50}"
if ! echo "$message" | grep -E "$requiredPattern" >/dev/null; then
echo "-"
echo "-"
echo "-"
echo "🚨 Wrong commit message! 😕"
echo "The commit message must have this format:"
echo "<verb in imperative mood> <what was done>"
echo "Allowed verbs in imperative mood: feat|fix|docs|style|refactor|workflow|perf|test|build|ci|chore|types"
echo "Allowed verbs in imperative mood: feat|fix|website|style|refactor|perf|test|build|ci|chore|types|workflow"
echo "Example: feat(style): add new feature"
echo "-"
echo "Your commit message was:"
Expand Down
1 change: 0 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env bash
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
Loading