Skip to content

Commit 6cd2055

Browse files
Bump the tseslint group with 2 updates (#335)
* Bump the tseslint group with 2 updates Bumps the tseslint group with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser). Updates `@typescript-eslint/eslint-plugin` from 7.0.0 to 8.19.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.19.0/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 6.21.0 to 8.19.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.19.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-major dependency-group: tseslint - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-major dependency-group: tseslint ... Signed-off-by: dependabot[bot] <[email protected]> * . * . * #7 build - added pre-commit and prepare-commit-msg hooks * #7 chore - update dependencies for tseslint package --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Guilherme Branco Stracini <[email protected]>
1 parent 8cb9bb5 commit 6cd2055

File tree

9 files changed

+26952
-1871
lines changed

9 files changed

+26952
-1871
lines changed

.githooks/pre-commit

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
LC_ALL=C
3+
4+
local_branch="$(git rev-parse --abbrev-ref HEAD)"
5+
6+
valid_branch_regex="^(penify|gitauto|dependabot|feature|fix|docs|style|refactor|perf|hotfix|test|chore|create)(\/[a-zA-Z0-9#._-]+)+$"
7+
8+
message="There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. Your commit will be rejected. You should rename your branch to a valid name and try again."
9+
10+
if [[ ! $local_branch =~ $valid_branch_regex ]]
11+
then
12+
echo "$message"
13+
exit 1
14+
fi
15+
16+
npm run lint

.githooks/prepare-commit-msg

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env sh
2+
3+
# This script generates an AI-powered commit message using dotnet-aicommitmessage.
4+
# It can be bypassed by setting the GIT_AICOMMIT_SKIP environment variable.
5+
6+
# Exit immediately if GIT_AICOMMIT_SKIP is set
7+
if [ -n "$GIT_AICOMMIT_SKIP" ]; then
8+
exit 0
9+
fi
10+
11+
# Check if dotnet-aicommitmessage is installed and in PATH
12+
if ! command -v dotnet-aicommitmessage >/dev/null 2>&1; then
13+
echo "Error: dotnet-aicommitmessage is not installed or not in PATH" >&2
14+
echo "Please install it by running 'dotnet tool install -g aicommitmessage'" >&2
15+
exit 1
16+
fi
17+
18+
# Ensure the commit message file is provided
19+
if [ -z "$1" ]; then
20+
echo "Error: Commit message file not provided" >&2
21+
exit 1
22+
fi
23+
24+
COMMIT_MSG_FILE="$1"
25+
26+
# Check if the commit message file exists
27+
if [ ! -f "$COMMIT_MSG_FILE" ]; then
28+
echo "Error: Commit message file '$COMMIT_MSG_FILE' not found" >&2
29+
exit 1
30+
fi
31+
32+
# Read the current commit message
33+
CURRENT_MESSAGE=$(cat "$COMMIT_MSG_FILE")
34+
35+
# Backup the commit message file
36+
cp "$COMMIT_MSG_FILE" "${COMMIT_MSG_FILE}.bak"
37+
38+
# Generate the AI commit message
39+
if ! AI_MESSAGE=$(dotnet-aicommitmessage generate-message -m "$CURRENT_MESSAGE" 2>/dev/null); then
40+
echo "Error: Failed to generate AI commit message. Using original message." >&2
41+
exit 0
42+
fi
43+
44+
# Check if the generated message is empty
45+
if [ -z "$AI_MESSAGE" ] || echo "$AI_MESSAGE" | grep -q '^[[:space:]]*$'; then
46+
echo "Error: Generated commit message is empty." >&2
47+
exit 1
48+
fi
49+
50+
# Write the new commit message back to the file
51+
if ! echo "$AI_MESSAGE" > "$COMMIT_MSG_FILE" 2>/dev/null; then
52+
echo "Error: Failed to write new commit message" >&2
53+
cp "${COMMIT_MSG_FILE}.bak" "$COMMIT_MSG_FILE"
54+
rm "${COMMIT_MSG_FILE}.bak"
55+
exit 1
56+
fi
57+
58+
# Remove the backup file
59+
rm "${COMMIT_MSG_FILE}.bak"
60+
exit 0

.github/linters/.eslintrc.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ rules:
5454
['error', { 'accessibility': 'no-public' }],
5555
'@typescript-eslint/explicit-function-return-type':
5656
['error', { 'allowExpressions': true }],
57-
'@typescript-eslint/func-call-spacing': ['error', 'never'],
5857
'@typescript-eslint/no-array-constructor': 'error',
5958
'@typescript-eslint/no-empty-interface': 'error',
6059
'@typescript-eslint/no-explicit-any': 'error',
@@ -77,8 +76,6 @@ rules:
7776
'@typescript-eslint/promise-function-async': 'error',
7877
'@typescript-eslint/require-array-sort-compare': 'error',
7978
'@typescript-eslint/restrict-plus-operands': 'error',
80-
'@typescript-eslint/semi': ['error', 'never'],
8179
'@typescript-eslint/space-before-function-paren': 'off',
82-
'@typescript-eslint/type-annotation-spacing': 'error',
8380
'@typescript-eslint/unbound-method': 'error'
8481
}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,4 @@ __tests__/runner/*
9999

100100
# IDE files
101101
.idea
102-
.vscode
103102
*.code-workspace

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sonarlint.connectedMode.project": {
3+
"connectionId": "guibranco",
4+
"projectKey": "guibranco_github-file-reader-action-v2"
5+
}
6+
}

0 commit comments

Comments
 (0)