Skip to content

Commit e9b5654

Browse files
authored
Merge pull request #11 from telexintegrations:feat/analyzer
feat(analyzer): add extra checks for quality of commit messages
2 parents ef5defb + e9bcd12 commit e9b5654

File tree

6 files changed

+196
-80
lines changed

6 files changed

+196
-80
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ project_root/
118118

119119
### Core Analysis Engine
120120

121-
The system implements a three-stage commit analysis pipeline:
121+
The system implements a multi-step process to evaluate the quality of commit messages:
122122

123123
#### Direct Pattern Matching
124124
- Matches against predefined commit types
@@ -173,6 +173,13 @@ semantic_patterns = {
173173
}
174174
```
175175

176+
#### Content Quality
177+
- It verifies that the commit message contains enough words. Messages with fewer than 5 words are flagged with a high-severity warning, while those with 5–9 words are flagged with a medium-severity warning.
178+
- Scans the commit message for words that might be gibberish.
179+
180+
#### Context Evaluation
181+
- Ensures that the commit message provides adequate context. It looks for a clear separation between the subject line and the detailed body (detected via a double newline \n\n). If this separation is missing, the method suggests splitting the message to improve clarity.
182+
176183
## API Documentation
177184

178185
### GitHub Webhook Endpoint

src/config/data.py

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -12,96 +12,96 @@
1212
}
1313

1414
example_commits = {
15-
"feat": "feat(auth): implement OAuth2 with role-based access",
16-
"fix": "fix(api): resolve data race in concurrent requests",
17-
"docs": "docs(api): update authentication documentation",
18-
"refactor": "refactor(core): simplify error handling logic",
19-
"chore": "chore(deps): update dependency versions to latest",
20-
"style": "style(components): format according to style guide",
21-
"perf": "perf(queries): optimize database index for faster lookups",
22-
"test": "test(api): add integration tests for payment flow",
15+
"feat": "feat(auth): implement OAuth2 with role-based access\n\nImplemented OAuth2 protocol with role-based control to enhance security and scalability.",
16+
"fix": "fix(api): resolve data race in concurrent requests\n\nFixed a race condition by adding synchronization mechanisms to prevent concurrent data modifications.",
17+
"docs": "docs(api): update authentication documentation\n\nUpdated API documentation to detail the new authentication methods and error handling procedures.",
18+
"refactor": "refactor(core): simplify error handling logic\n\nRefactored error handling to remove redundancies and improve code maintainability.",
19+
"chore": "chore(deps): update dependency versions to latest\n\nUpgraded dependencies to address security vulnerabilities and improve performance.",
20+
"style": "style(components): format according to style guide\n\nReformatted code to comply with style guidelines for better readability and consistency.",
21+
"perf": "perf(queries): optimize database index for faster lookups\n\nEnhanced database indexing strategy to improve query performance on large datasets.",
22+
"test": "test(api): add integration tests for payment flow\n\nAdded integration tests to ensure reliable and consistent performance of the payment processing system."
2323
}
2424

2525
commit_training_data = {
2626
"feat": [
27-
"feat(auth): implement JWT authentication flow",
28-
"feat(ui): add dark mode toggle with system preference detection",
29-
"feat(api): implement rate limiting middleware",
30-
"feat(forms): add client-side form validation",
31-
"feat(search): implement elasticsearch integration",
32-
"feat(cache): add Redis caching layer for API responses",
33-
"feat(auth): implement social login providers",
34-
"feat(security): add two-factor authentication support",
27+
"feat(auth): implement JWT authentication flow\n\nImplemented JWT-based authentication with token expiration handling to secure user sessions.",
28+
"feat(ui): add dark mode toggle with system preference detection\n\nAdded dark mode toggle that automatically adjusts based on system settings for improved user experience.",
29+
"feat(api): implement rate limiting middleware\n\nIntroduced rate limiting to prevent API abuse and ensure system stability under high load.",
30+
"feat(forms): add client-side form validation\n\nImplemented real-time form validation to provide immediate feedback and improve data integrity.",
31+
"feat(search): implement elasticsearch integration\n\nIntegrated Elasticsearch to boost search performance and enhance result accuracy.",
32+
"feat(cache): add Redis caching layer for API responses\n\nAdded a Redis caching layer to reduce response times and improve overall scalability.",
33+
"feat(auth): implement social login providers\n\nEnabled social login functionality to simplify the authentication process for users.",
34+
"feat(security): add two-factor authentication support\n\nIntroduced two-factor authentication to enhance account security and reduce fraud risks.",
3535
],
3636
"fix": [
37-
"fix(auth): resolve token refresh race condition",
38-
"fix(api): handle concurrent request deadlocks",
39-
"fix(validation): correct email regex pattern",
40-
"fix(memory): resolve memory leak in WebSocket connections",
41-
"fix(security): patch SQL injection vulnerability",
42-
"fix(cors): resolve cross-origin request issues",
43-
"fix(cache): handle cache invalidation edge cases",
44-
"fix(ui): resolve mobile viewport rendering issues",
37+
"fix(auth): resolve token refresh race condition\n\nFixed a race condition in the token refresh logic by implementing proper synchronization mechanisms.",
38+
"fix(api): handle concurrent request deadlocks\n\nResolved API deadlocks by optimizing resource locking and request handling procedures.",
39+
"fix(validation): correct email regex pattern\n\nUpdated the email validation regex to accurately handle various valid email formats.",
40+
"fix(memory): resolve memory leak in WebSocket connections\n\nAddressed a memory leak by ensuring WebSocket connections are properly closed after use.",
41+
"fix(security): patch SQL injection vulnerability\n\nPatched a SQL injection vulnerability by sanitizing user inputs and using parameterized queries.",
42+
"fix(cors): resolve cross-origin request issues\n\nAdjusted CORS settings to correctly handle cross-origin requests and improve security.",
43+
"fix(cache): handle cache invalidation edge cases\n\nFixed issues with cache invalidation to ensure data consistency across different layers.",
44+
"fix(ui): resolve mobile viewport rendering issues\n\nCorrected viewport meta tag settings to improve rendering on mobile devices.",
4545
],
4646
"docs": [
47-
"docs(api): update REST endpoints documentation",
48-
"docs(setup): improve installation instructions",
49-
"docs(auth): document OAuth2 implementation details",
50-
"docs(deploy): add AWS deployment guide",
51-
"docs(contributing): update PR guidelines",
52-
"docs(api): add GraphQL schema documentation",
53-
"docs(security): document security best practices",
54-
"docs(testing): update e2e testing guide",
47+
"docs(api): update REST endpoints documentation\n\nRevised REST API documentation to include detailed information on new endpoints and error handling.",
48+
"docs(setup): improve installation instructions\n\nEnhanced installation guide with step-by-step instructions and troubleshooting tips for new users.",
49+
"docs(auth): document OAuth2 implementation details\n\nProvided comprehensive documentation covering OAuth2 flows, configuration, and security considerations.",
50+
"docs(deploy): add AWS deployment guide\n\nCreated a detailed guide for deploying the application on AWS, including best practices and configuration tips.",
51+
"docs(contributing): update PR guidelines\n\nUpdated contributing guidelines to reflect new review processes and code standards.",
52+
"docs(api): add GraphQL schema documentation\n\nIncluded detailed documentation for the GraphQL schema to help developers understand query structures.",
53+
"docs(security): document security best practices\n\nOutlined security best practices and compliance requirements for developers and auditors.",
54+
"docs(testing): update e2e testing guide\n\nRevised the end-to-end testing documentation with new scenarios and tool integrations.",
5555
],
5656
"refactor": [
57-
"refactor(api): split monolithic controller into modules",
58-
"refactor(db): optimize database query patterns",
59-
"refactor(auth): separate authentication logic",
60-
"refactor(middleware): improve error handling flow",
61-
"refactor(utils): create shared utility functions",
62-
"refactor(services): implement repository pattern",
63-
"refactor(validation): centralize validation logic",
64-
"refactor(config): improve configuration management",
57+
"refactor(api): split monolithic controller into modules\n\nRefactored the API controller into modular components to enhance maintainability and scalability.",
58+
"refactor(db): optimize database query patterns\n\nImproved database performance by optimizing complex queries and reducing unnecessary joins.",
59+
"refactor(auth): separate authentication logic\n\nIsolated authentication logic into a dedicated module for clearer structure and easier testing.",
60+
"refactor(middleware): improve error handling flow\n\nStreamlined error handling within middleware to ensure consistent responses across the application.",
61+
"refactor(utils): create shared utility functions\n\nExtracted common code into shared utilities to reduce duplication and simplify maintenance.",
62+
"refactor(services): implement repository pattern\n\nAdopted the repository pattern in the services layer to decouple business logic from data access.",
63+
"refactor(validation): centralize validation logic\n\nCentralized various validation routines into a single module for consistency and reuse.",
64+
"refactor(config): improve configuration management\n\nRefactored configuration handling by separating environment-specific settings into distinct files.",
6565
],
6666
"chore": [
67-
"chore(deps): update package dependencies to latest",
68-
"chore(ci): update GitHub Actions workflow",
69-
"chore(docker): optimize container build process",
70-
"chore(lint): update ESLint configuration",
71-
"chore(git): update gitignore patterns",
72-
"chore(deps): remove unused dependencies",
73-
"chore(scripts): update build scripts",
74-
"chore(types): update TypeScript definitions",
67+
"chore(deps): update package dependencies to latest\n\nUpgraded all package dependencies to their latest versions to address security issues and improve performance.",
68+
"chore(ci): update GitHub Actions workflow\n\nRevised the CI pipeline to streamline automated testing and deployment processes.",
69+
"chore(docker): optimize container build process\n\nOptimized the Dockerfile to reduce image build times and improve container efficiency.",
70+
"chore(lint): update ESLint configuration\n\nUpdated ESLint rules to enforce new coding standards and remove deprecated configurations.",
71+
"chore(git): update gitignore patterns\n\nRefined the .gitignore file to exclude unnecessary files and reduce repository clutter.",
72+
"chore(deps): remove unused dependencies\n\nCleaned up the project by removing outdated and unused dependencies to simplify maintenance.",
73+
"chore(scripts): update build scripts\n\nEnhanced build scripts for better readability and efficiency during the deployment process.",
74+
"chore(types): update TypeScript definitions\n\nUpdated TypeScript definition files to reflect recent changes in the codebase.",
7575
],
7676
"style": [
77-
"style(css): align with design system guidelines",
78-
"style(components): update button styling",
79-
"style(layout): improve responsive grid system",
80-
"style(theme): update color palette variables",
81-
"style(forms): standardize input field styling",
82-
"style(fonts): update typography system",
83-
"style(animations): refine transition effects",
84-
"style(icons): update icon system to SVG",
77+
"style(css): align with design system guidelines\n\nUpdated CSS styles to conform with the latest design system standards for better consistency.",
78+
"style(components): update button styling\n\nRefined button styling to improve visual hierarchy and overall usability in the UI.",
79+
"style(layout): improve responsive grid system\n\nEnhanced the grid layout to ensure consistent behavior across multiple device sizes.",
80+
"style(theme): update color palette variables\n\nModified theme variables to reflect new branding and improve the overall aesthetic appeal.",
81+
"style(forms): standardize input field styling\n\nStandardized the styling of form inputs for a cohesive look throughout the application.",
82+
"style(fonts): update typography system\n\nUpdated typography settings to enhance readability and maintain visual consistency.",
83+
"style(animations): refine transition effects\n\nImproved transition effects for smoother animations and better user interaction.",
84+
"style(icons): update icon system to SVG\n\nReplaced icon fonts with SVG icons to ensure scalability and clarity on all devices.",
8585
],
8686
"perf": [
87-
"perf(images): implement lazy loading strategy",
88-
"perf(api): add query result caching",
89-
"perf(db): optimize database indices",
90-
"perf(bundle): reduce JavaScript bundle size",
91-
"perf(assets): implement CDN distribution",
92-
"perf(queries): optimize database join operations",
93-
"perf(cache): implement LRU caching strategy",
94-
"perf(api): implement response compression",
87+
"perf(images): implement lazy loading strategy\n\nImplemented lazy loading for images to defer off-screen loading and improve page load times.",
88+
"perf(api): add query result caching\n\nIntroduced caching for API query results to reduce response times and lower server load.",
89+
"perf(db): optimize database indices\n\nRevised database indices to accelerate query performance and reduce data retrieval latency.",
90+
"perf(bundle): reduce JavaScript bundle size\n\nMinimized bundle size by removing unused code and optimizing dependency imports.",
91+
"perf(assets): implement CDN distribution\n\nConfigured CDN distribution for static assets to boost load times and global accessibility.",
92+
"perf(queries): optimize database join operations\n\nEnhanced join query efficiency to better handle large datasets and reduce processing time.",
93+
"perf(cache): implement LRU caching strategy\n\nAdopted an LRU caching strategy to improve memory management and response speed.",
94+
"perf(api): implement response compression\n\nEnabled compression for API responses to decrease payload size and improve transfer speeds.",
9595
],
9696
"test": [
97-
"test(api): add integration tests for auth flow",
98-
"test(ui): add unit tests for form validation",
99-
"test(e2e): add checkout flow tests",
100-
"test(utils): improve test coverage for helpers",
101-
"test(auth): add OAuth callback tests",
102-
"test(api): add load testing scenarios",
103-
"test(security): add penetration testing suite",
104-
"test(performance): add benchmark tests",
97+
"test(api): add integration tests for auth flow\n\nAdded comprehensive integration tests to validate the authentication flow under various scenarios.",
98+
"test(ui): add unit tests for form validation\n\nImplemented unit tests to ensure that all form validations perform correctly and reliably.",
99+
"test(e2e): add checkout flow tests\n\nDeveloped end-to-end tests to simulate the complete checkout process and identify any issues.",
100+
"test(utils): improve test coverage for helpers\n\nEnhanced test coverage for utility functions to catch edge cases and improve overall stability.",
101+
"test(auth): add OAuth callback tests\n\nAdded tests specifically for OAuth callback functionality to ensure proper third-party integration.",
102+
"test(api): add load testing scenarios\n\nImplemented load testing to evaluate API performance under high traffic conditions.",
103+
"test(security): add penetration testing suite\n\nIntroduced a penetration testing suite to identify and mitigate potential security vulnerabilities.",
104+
"test(performance): add benchmark tests\n\nAdded benchmark tests to measure performance improvements and track regression over time.",
105105
],
106106
}
107107

src/config/integration_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ def generate_json_config():
3939
"type": "text",
4040
"required": True,
4141
"description": "Set example commits for each custom commit type to guide new devs. These appear in suggestions when similar commits need fixing. Format: {'type1': 'example message1', 'type2': 'example message 2'}.",
42-
"default": "{'feat': 'feat(auth): implement 0Auth2 with role-based access', 'fix': 'fix(api): resolve data race in concurrent requests'}"
42+
"default": "{'feat': 'feat(auth): implement OAuth2 with role-based access\n\nImplemented OAuth2 protocol with role-based control to enhance security and scalability.', 'fix': 'fix(api): resolve data race in concurrent requests\n\nFixed a race condition by adding synchronization mechanisms to prevent concurrent data modifications.'}"
4343
},
4444
{
4545
"label": "Training Data",
4646
"type": "text",
4747
"required": True,
4848
"description": "Add custom data to train the analyzer with commits that match preferred style. More examples = better suggestions. Format: {'type1': ['example1', 'example2'], 'type2': ['example3', 'example4']}. The analyzer learns from these to better match preferred conventions.",
49-
"default": "{'feat': ['feat(ui): add dark mode toggle with system preference detection','feat(auth): implement JWT authentication flow','feat(api): implement rate limiting middleware','feat(forms): add client-side form validation','feat(search): implement elasticsearch integration','feat(cache): add Redis caching layer for API responses','feat(auth): implement social login providers','feat(security): add two-factor authentication support']}"
49+
"default": "{'feat': ['feat(auth): implement OAuth2 with role-based access\n\nImplemented OAuth2 protocol with role-based control to enhance security and scalability.','feat(search): implement elasticsearch integration\n\nIntegrated Elasticsearch to boost search performance and enhance result accuracy.']}"
5050
}
5151
],
5252
"target_url": settings.target_url

0 commit comments

Comments
 (0)