Skip to content

Commit 09ee2e6

Browse files
committed
feat: integrate Husky and lint-staged for automated code quality checks; update changelog and README for new features
1 parent dd931ee commit 09ee2e6

File tree

9 files changed

+504
-5
lines changed

9 files changed

+504
-5
lines changed

.github/workflows/check_code_quality.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,28 @@ jobs:
88
timeout-minutes: 10
99

1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212

1313
- name: Install Node
14-
uses: actions/setup-node@v1
14+
uses: actions/setup-node@v4
1515
with:
1616
node-version: 20.x
1717

18+
- name: Cache node modules
19+
uses: actions/cache@v3
20+
with:
21+
path: ~/.npm
22+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
23+
restore-keys: |
24+
${{ runner.os }}-node-
25+
1826
- name: Install packages
19-
run: npm install
27+
run: npm ci
2028

2129
- name: Check linting
2230
run: npm run lint:check
2331

24-
- name: Check build
32+
- name: Generate Prisma client
2533
run: npm run db:generate
2634

2735
- name: Check build

.husky/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Git Hooks Configuration
2+
3+
Este projeto usa [Husky](https://typicode.github.io/husky/) para automatizar verificações de qualidade de código.
4+
5+
## Hooks Configurados
6+
7+
### Pre-commit
8+
- **Arquivo**: `.husky/pre-commit`
9+
- **Executa**: `npx lint-staged`
10+
- **Função**: Executa lint e correções automáticas apenas nos arquivos modificados
11+
12+
### Pre-push
13+
- **Arquivo**: `.husky/pre-push`
14+
- **Executa**: `npm run build` + `npm run lint:check`
15+
- **Função**: Verifica se o projeto compila e não tem erros de lint antes do push
16+
17+
## Lint-staged Configuration
18+
19+
Configurado no `package.json`:
20+
21+
```json
22+
"lint-staged": {
23+
"src/**/*.{ts,js}": [
24+
"eslint --fix",
25+
"git add"
26+
],
27+
"src/**/*.ts": [
28+
"npm run build"
29+
]
30+
}
31+
```
32+
33+
## Como funciona
34+
35+
1. **Ao fazer commit**: Executa lint apenas nos arquivos modificados
36+
2. **Ao fazer push**: Executa build completo e verificação de lint
37+
3. **Se houver erros**: O commit/push é bloqueado até correção
38+
39+
## Comandos úteis
40+
41+
```bash
42+
# Pular hooks (não recomendado)
43+
git commit --no-verify
44+
git push --no-verify
45+
46+
# Executar lint manualmente
47+
npm run lint
48+
49+
# Executar build manualmente
50+
npm run build
51+
```

.husky/pre-commit

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

.husky/pre-push

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
npm run build
2+
npm run lint:check

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
### Fixed
1010

1111
* Address Path Traversal vulnerability in /assets endpoint by implementing security checks
12+
* Configure Husky and lint-staged for automated code quality checks on commits and pushes
1213
* Convert mediaKey from media messages to avoid bad decrypt errors
1314
* Improve code formatting for better readability in WhatsApp service files
1415
* Format messageGroupId assignment for improved readability
@@ -18,6 +19,7 @@
1819
* Remove abort process when status is paused, allowing the chatbot return after the time expires and after being paused due to human interaction (stopBotFromMe)
1920
* Enhance message content sanitization in Baileys service and improve message retrieval logic in Chatwoot service
2021
* Integrate Typebot status change events for webhook in chatbot controller and service
22+
* Mimetype of videos video
2123

2224
### Security
2325

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
[![Discord Community](https://img.shields.io/badge/Discord-Community-blue)](https://evolution-api.com/discord)
88
[![Postman Collection](https://img.shields.io/badge/Postman-Collection-orange)](https://evolution-api.com/postman)
99
[![Documentation](https://img.shields.io/badge/Documentation-Official-green)](https://doc.evolution-api.com)
10+
[![Feature Requests](https://img.shields.io/badge/Feature-Requests-purple)](https://evolutionapi.canny.io/feature-requests)
11+
[![Roadmap](https://img.shields.io/badge/Roadmap-Community-blue)](https://evolutionapi.canny.io/feature-requests)
12+
[![Changelog](https://img.shields.io/badge/Changelog-Updates-green)](https://evolutionapi.canny.io/changelog)
1013
[![License](https://img.shields.io/badge/license-Apache--2.0-blue)](./LICENSE)
1114
[![Support](https://img.shields.io/badge/Donation-picpay-green)](https://app.picpay.com/user/davidsongomes1998)
1215
[![Sponsors](https://img.shields.io/badge/Github-sponsor-orange)](https://github.com/sponsors/EvolutionAPI)
@@ -67,6 +70,20 @@ Evolution API supports various integrations to enhance its functionality. Below
6770
- Amazon S3 / Minio:
6871
- Store media files received in [Amazon S3](https://aws.amazon.com/pt/s3/) or [Minio](https://min.io/).
6972

73+
## Community & Feedback
74+
75+
We value community input and feedback to continuously improve Evolution API:
76+
77+
### 🚀 Feature Requests & Roadmap
78+
- **[Feature Requests](https://evolutionapi.canny.io/feature-requests)**: Submit new feature ideas and vote on community proposals
79+
- **[Roadmap](https://evolutionapi.canny.io/feature-requests)**: View planned features and development progress
80+
- **[Changelog](https://evolutionapi.canny.io/changelog)**: Stay updated with the latest releases and improvements
81+
82+
### 💬 Community Support
83+
- **[WhatsApp Group](https://evolution-api.com/whatsapp)**: Join our community for support and discussions
84+
- **[Discord Community](https://evolution-api.com/discord)**: Real-time chat with developers and users
85+
- **[GitHub Issues](https://github.com/EvolutionAPI/evolution-api/issues)**: Report bugs and technical issues
86+
7087
## Telemetry Notice
7188

7289
To continuously improve our services, we have implemented telemetry that collects data on the routes used, the most accessed routes, and the version of the API in use. We would like to assure you that no sensitive or personal data is collected during this process. The telemetry helps us identify improvements and provide a better experience for users.

0 commit comments

Comments
 (0)