Skip to content

Commit 7e5c262

Browse files
committed
feat: add CodeRabbit AI review configuration and update project setup
- Add comprehensive .coderabbit.yaml configuration for automated code reviews - Update GitHub workflow configurations and settings - Update README.md with new project information and badges - Refactor setup scripts and test files - Update .gitignore with new rules - Improve test coverage and project scaffolding This commit introduces automated code quality checks and improves project setup.
1 parent 39be4ce commit 7e5c262

10 files changed

Lines changed: 290 additions & 33 deletions

.coderabbit.yaml

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
# CodeRabbit Configuration
2+
# Configuration for code quality, security, and linting
3+
4+
# Linting configuration
5+
lint:
6+
# Dockerfile linting
7+
dockerfile:
8+
enabled: true
9+
config:
10+
rules:
11+
hadolint:
12+
DL3008: warning # Pin versions in apt-get install
13+
DL3013: warning # Pin versions in pip install
14+
DL4000: error # MAINTAINER is deprecated
15+
DL3003: error # Use WORKDIR instead of cd
16+
DL3007: warning # Using latest is discouraged
17+
DL3015: error # Avoid additional packages
18+
DL3018: warning # Pin versions in apk add
19+
DL3020: error # Use COPY instead of ADD
20+
DL3045: warning # COPY with more than 2 arguments
21+
DL3059: error # Multiple consecutive RUN commands
22+
23+
# HTML linting (using HTMLHint)
24+
html:
25+
enabled: true
26+
config:
27+
rules:
28+
'tagname-lowercase': true
29+
'attr-lowercase': true
30+
'attr-value-double-quotes': true
31+
'spec-char-escape': true
32+
'id-unique': true
33+
'src-not-empty': true
34+
'alt-require': true
35+
'title-require': true
36+
'doctype-first': true
37+
'id-class-value': 'dash'
38+
'inline-style-disabled': true
39+
'inline-script-disabled': true
40+
'space-tab-mixed-disabled': 'space'
41+
'id-class-ad-disabled': true
42+
'href-abs-or-rel': false
43+
'attr-unsafe-chars': true
44+
45+
# CSS/SCSS linting (using Stylelint)
46+
css:
47+
enabled: true
48+
config:
49+
extends: 'stylelint-config-standard'
50+
rules:
51+
'at-rule-no-unknown': [true, {
52+
ignoreAtRules: ['tailwind', 'apply', 'layer', 'variants', 'responsive', 'screen']
53+
}]
54+
'declaration-block-trailing-semicolon': 'always'
55+
'no-descending-specificity': null
56+
'selector-class-pattern': '^[a-z][a-zA-Z0-9]+$'
57+
'selector-pseudo-class-no-unknown': [true, {
58+
ignorePseudoClasses: ['global']
59+
}]
60+
'property-no-unknown': [true, {
61+
ignoreProperties: ['composes']
62+
}]
63+
64+
# Shell script linting (using ShellCheck)
65+
shell:
66+
enabled: true
67+
config:
68+
exclude:
69+
- SC1090 # Can't follow non-constant source
70+
- SC1091 # Not following
71+
- SC2155 # Declare and assign separately
72+
warning:
73+
- SC2086 # Double quote to prevent globbing
74+
- SC2006 # Use $(...) notation
75+
- SC2016 # Expressions don't expand in single quotes
76+
error:
77+
- SC2181 # Check exit code directly
78+
- SC2317 # Command appears to be unreachable
79+
80+
# Markdown linting
81+
markdown:
82+
enabled: true
83+
config:
84+
MD013: # Line length
85+
line_length: 120
86+
code_blocks: false
87+
tables: false
88+
MD033: # Inline HTML
89+
allowed_elements: ['br', 'img', 'a', 'div', 'h1', 'h2', 'h3', 'p', 'b', 'i', 'u']
90+
MD041: # First line should be a top-level heading
91+
level: 1
92+
MD047: # Files should end with a single newline
93+
require: true
94+
95+
# Python linting (using Pylint)
96+
python:
97+
enabled: true
98+
config:
99+
master:
100+
disable: 'C0114,C0115,C0116' # Disable docstring requirements
101+
messages_control:
102+
disable:
103+
- 'C0103' # Invalid name
104+
- 'R0903' # Too few public methods
105+
- 'R0913' # Too many arguments
106+
basic:
107+
max-line-length: 120
108+
format:
109+
max-line-length: 120
110+
design:
111+
max-args: 6
112+
max-locals: 15
113+
max-returns: 6
114+
max-statements: 50
115+
similarity:
116+
min-similarity-lines: 4
117+
118+
# JavaScript/TypeScript linting (ESLint)
119+
javascript:
120+
enabled: true
121+
config:
122+
extends:
123+
- 'eslint:recommended'
124+
- 'plugin:@typescript-eslint/recommended'
125+
- 'plugin:react/recommended'
126+
- 'plugin:react-hooks/recommended'
127+
parser: '@typescript-eslint/parser'
128+
parserOptions:
129+
ecmaVersion: 2021,
130+
sourceType: 'module',
131+
ecmaFeatures:
132+
jsx: true
133+
settings:
134+
react:
135+
version: 'detect'
136+
rules:
137+
# Core rules
138+
'no-console': 'warn',
139+
'no-debugger': 'error',
140+
'no-unused-vars': ['warn', { 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_' }],
141+
'prefer-const': 'warn',
142+
'eqeqeq': ['error', 'always'],
143+
'no-eval': 'error',
144+
'no-var': 'error',
145+
'prefer-template': 'warn',
146+
'template-curly-spacing': 'error',
147+
'no-duplicate-imports': 'error',
148+
'no-useless-constructor': 'warn',
149+
'no-useless-rename': 'warn',
150+
'rest-spread-spacing': 'error',
151+
'semi': ['error', 'always'],
152+
'quotes': ['error', 'single', { 'avoidEscape': true }],
153+
'indent': ['error', 2, { 'SwitchCase': 1 }],
154+
'comma-dangle': ['error', 'always-multiline'],
155+
'object-curly-spacing': ['error', 'always'],
156+
'array-bracket-spacing': ['error', 'never'],
157+
'keyword-spacing': 'error',
158+
'space-before-blocks': 'error',
159+
'space-before-function-paren': ['error', 'never'],
160+
'space-in-parens': ['error', 'never'],
161+
'space-infix-ops': 'error',
162+
'space-unary-ops': 'error',
163+
'spaced-comment': 'warn',
164+
'arrow-spacing': 'error',
165+
'no-implied-eval': 'error',
166+
'no-multi-spaces': 'error',
167+
'no-multi-str': 'error',
168+
'no-new-wrappers': 'error',
169+
'no-self-compare': 'error',
170+
'no-sequences': 'error',
171+
'no-throw-literal': 'error',
172+
'no-unused-expressions': 'warn',
173+
'no-useless-call': 'error',
174+
'no-void': 'error',
175+
'prefer-promise-reject-errors': 'error',
176+
'radix': 'error',
177+
'yoda': 'error',
178+
179+
# TypeScript specific
180+
'@typescript-eslint/explicit-function-return-type': 'off',
181+
'@typescript-eslint/explicit-module-boundary-types': 'off',
182+
'@typescript-eslint/no-explicit-any': 'warn',
183+
'@typescript-eslint/no-unused-vars': ['warn', { 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_' }],
184+
185+
# React specific
186+
'react/react-in-jsx-scope': 'off',
187+
'react/prop-types': 'off',
188+
'react/jsx-uses-react': 'off',
189+
'react/jsx-uses-vars': 'error',
190+
'react-hooks/rules-of-hooks': 'error',
191+
'react-hooks/exhaustive-deps': 'warn'
192+
193+
review:
194+
enabled: true
195+
auto_submit: true
196+
update_comment: true
197+
198+
comments:
199+
show_code_suggestions: true
200+
show_security_issues: true
201+
show_performance_improvements: true
202+
203+
# Focus on source and test files only
204+
files:
205+
include:
206+
- "src/**/*"
207+
- "tests/**/*"
208+
- "*.{js,ts,json,md}"
209+
210+
# Exclude common directories and files
211+
exclude:
212+
- "**/node_modules"
213+
- "**/dist"
214+
- "**/build"
215+
- "**/*.min.*"
216+
- "**/.git"
217+
- "**/package-lock.json"
218+
- "**/yarn.lock"
219+
- "**/__pycache__/**"
220+
221+
# Security scanning
222+
security:
223+
enabled: true
224+
dependency_check: true # Checks package.json for known vulnerabilities
225+
secret_scanning: true # Looks for exposed secrets
226+
227+
# Basic PR quality checks
228+
pr_size:
229+
large_threshold: 500 # Warn if PR > 500 lines
230+
xlarge_threshold: 1000 # Block if PR > 1000 lines
231+
232+
# Documentation checks
233+
documentation:
234+
require_updates: true
235+
check_readme: true
236+
237+
# Simple custom rules
238+
custom_rules:
239+
- name: "Avoid console.log in production"
240+
pattern: "console\\.(log|warn|error|info)"
241+
message: "Consider using a proper logging library in production"
242+
level: "warning"
243+
244+
# Ignore common directories
245+
global_ignore:
246+
- "**/node_modules"
247+
- "**/dist"
248+
- "**/build"
249+
- "**/.git"
250+
- "**/*.min.*"
251+
- "**/__pycache__/**"
252+
253+
# Basic PR requirements
254+
pr_description:
255+
required: true
256+
min_length: 200
257+
require_issue_reference: true

.github/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Comment to be posted to on first time issues
44
newIssueWelcomeComment: >
5-
Thanks for opening your first issue in TuxTechLab/TuxTechLab-Template-Repo! Be sure to follow the issue template and provide every bit of information to help the developers!
5+
Thanks for opening your first issue in TuxTechLab/TuxTechLabWebsite! Be sure to follow the issue template and provide every bit of information to help the developers!
66
77
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
88

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
###> TuxTechLab/TuxTechLab-Template-Repo ###
1+
###> TuxTechLab/TuxTechLabWebsite ###
22

33
##### Folders #####
44
build/
@@ -180,4 +180,4 @@ cython_debug/
180180
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
181181
#.idea/
182182

183-
###< TuxTechLab/TuxTechLab-Template-Repo ###
183+
###< TuxTechLab/TuxTechLabWebsite ###

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ TuxTechLabWebsite/
153153

154154
## 🍰 **Supporters and donators**
155155

156-
<a href="https://github.com/TuxTechLab/TuxTechLab-Template-Repo/generate">
157-
<img alt="@TuxTechLab/TuxTechLab-Template-Repo's brand logo without text" align="right" src="https://i.imgur.com/3qK1sie.png" width="18%" />
156+
<a href="https://github.com/TuxTechLab/TuxTechLabWebsite/generate">
157+
<img alt="@TuxTechLab/TuxTechLabWebsite's brand logo without text" align="right" src="https://i.imgur.com/3qK1sie.png" width="18%" />
158158
</a>
159159

160160
We are currently looking for new donators to help and maintain this project! ❤️

SETUP_TEMPLATE.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#
44
# SCRIPT: SETUP_TEMPLATE.sh
55
# USAGE: bash SETUP_TEMPLATE.sh | ./SETUP_TEMPLATE.sh
6-
# PURPOSE: Shell script that setups the @TuxTechLab/TuxTechLab-Template-Repo GitHub project template.
6+
# PURPOSE: Shell script that setups the @TuxTechLab/TuxTechLabWebsite GitHub project template.
77
# It detects the user's GitHub username, email and project name,
88
# and then prompts for the type of project that it is. All the data can be manually specified using
99
# the script optional arguments. For more information, please execute the script with the '--help' flag.
@@ -15,10 +15,10 @@
1515
# NOTES: This script will auto remove itself, and if you want to rerun it, the user must download
1616
# it again or do a 'git stash' and revert the changes.
1717
# BASH_VERSION: 5.1.4(1)-release (x86_64-pc-linux-gnu)
18-
# LICENSE: see in LICENSE (project root) or https://github.com/TuxTechLab/TuxTechLab-Template-Repo/blob/master/LICENSE
18+
# LICENSE: see in LICENSE (project root) or https://github.com/TuxTechLab/TuxTechLabWebsite/blob/master/LICENSE
1919
# GITHUB: https://github.com/TuxTechLab/
20-
# REPOSITORY: https://github.com/TuxTechLab/TuxTechLab-Template-Repo
21-
# ISSUES: https://github.com/TuxTechLab/TuxTechLab-Template-Repo/issues
20+
# REPOSITORY: https://github.com/TuxTechLab/TuxTechLabWebsite
21+
# ISSUES: https://github.com/TuxTechLab/TuxTechLabWebsite/issues
2222
# MAIL: admin@tuxtechlab.com
2323
#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#
2424

@@ -79,7 +79,7 @@ displayHelpTexts() {
7979
echo -e "\n ${CYAN}Mixed Formats:${NC}"
8080
echo -e " $0 -u myuser --email=me@example.com -p=myproject --type website"
8181

82-
echo -e "\n${BOLD}Note:${NC} For more information, visit ${UPURPLE}https://github.com/TuxTechLab/TuxTechLab-Template-Repo${NC}"
82+
echo -e "\n${BOLD}Note:${NC} For more information, visit ${UPURPLE}https://github.com/TuxTechLab/TuxTechLabWebsite${NC}"
8383

8484
exit 0
8585
}
@@ -181,8 +181,8 @@ parse_arguments() {
181181
# Parse the command line arguments
182182
parse_arguments "$@"
183183

184-
echo -e "Thanks for using ${GREEN}@TuxTechLab/TuxTechLab-Template-Repo${NC}"
185-
echo -e "Read all the documentation carefully before you continue executing this script: ${UPURPLE}https://github.com/TuxTechLab/TuxTechLab-Template-Repo${NC}\n"
184+
echo -e "Thanks for using ${GREEN}@TuxTechLab/TuxTechLabWebsite${NC}"
185+
echo -e "Read all the documentation carefully before you continue executing this script: ${UPURPLE}https://github.com/TuxTechLab/TuxTechLabWebsite${NC}\n"
186186

187187
bash tests/TESTS_RUNNER.sh >/dev/null 2>&1 # PERFORM the TESTS
188188

@@ -226,7 +226,7 @@ y | Y)
226226
git add CHANGELOG.md README.md .gitignore .github SETUP_TEMPLATE.sh LICENSE bin tests
227227
git -c color.status=always status | less -REX
228228
echo -e "Committing the changes for you :)\n"
229-
git commit -m "📝 Set up '@TuxTechLab/TuxTechLab-Template-Repo' template: Personalized files by executing the SETUP_TEMPLATE.sh script.🚀"
229+
git commit -m "📝 Set up '@TuxTechLab/TuxTechLabWebsite' template: Personalized files by executing the SETUP_TEMPLATE.sh script.🚀"
230230
echo -e "\nRemember to review every file and customize it as you like.\nYou are ready to start your brand new awesome project🚀🚀."
231231
else
232232
echo -e "\n${YELLOW}Changes have been made but not committed (--omit-commit was specified).${NC}"

bin/FUNCTION_HELPERS.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
# NOTES: This script will auto remove itself, and in case of wanting to run it again, the user must download
1010
# it again or do a 'git stash' and revert the changes.
1111
# BASH_VERSION: 5.1.4(1)-release (x86_64-pc-linux-gnu)
12-
# LICENSE: see in ../LICENSE (project root) or https://github.com/TuxTechLab/TuxTechLab-Template-Repo/blob/master/LICENSE
12+
# LICENSE: see in ../LICENSE (project root) or https://github.com/TuxTechLab/TuxTechLabWebsite/blob/master/LICENSE
1313
# GITHUB: https://github.com/TuxTechLab/
14-
# REPOSITORY: https://github.com/TuxTechLab/TuxTechLab-Template-Repo
15-
# ISSUES: https://github.com/TuxTechLab/TuxTechLab-Template-Repo/issues
14+
# REPOSITORY: https://github.com/TuxTechLab/TuxTechLabWebsite
15+
# ISSUES: https://github.com/TuxTechLab/TuxTechLabWebsite/issues
1616
# MAIL: admin@tuxtechlab.com
1717
#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#
1818

@@ -38,7 +38,7 @@ center() {
3838
displayTestErrorTexts() {
3939
echo -e "${RED}X ERROR: The tests failed!${NC}. Please, make sure that you are running this script with its original scaffolding (folder/file) structure without any modification.${NC}"
4040
echo -e "You should try to 'git stash' your changes and execute this script from the project root again, or clone again the repository (the template) without any changes."
41-
echo -e "Remember that your brand new repository should be created from here: ${BOLD}${UPURPLE}https://github.com/TuxTechLab/TuxTechLab-Template-Repo/generate${NC}"
41+
echo -e "Remember that your brand new repository should be created from here: ${BOLD}${UPURPLE}https://github.com/TuxTechLab/TuxTechLabWebsite/generate${NC}"
4242
echo -e "\nThe program will now exit for you to check if this script is executed right when creating your new repository from the link above."
4343
echo -e "To omit this error and proceed please execute this script again with the flag '${GREEN}--omit-test-check${NC}'"
4444
echo -e "For more information about the script, use the '${BBLUE}--help${NC}' flag."
@@ -69,8 +69,8 @@ displayHelpTexts() { # (it will manually detect your git data and prompt for the
6969
echo -e " bash $0 -u=TuxTechLab --projectType=Github-template --omit-commit${NC}\n"
7070

7171
echo -e "The username, project-name and email are automatically gathered from your git repository and git config."
72-
echo -e "Make sure you have ${BBLUE}read the documentation before executing${NC} this script: ${UPURPLE}https://github.com/TuxTechLab/TuxTechLab-Template-Repo${NC}"
73-
echo -e "If you have any questions or if any issue is found, please make sure to report it at: ${UPURPLE}https://github.com/TuxTechLab/TuxTechLab-Template-Repo/issues${NC}"
72+
echo -e "Make sure you have ${BBLUE}read the documentation before executing${NC} this script: ${UPURPLE}https://github.com/TuxTechLab/TuxTechLabWebsite${NC}"
73+
echo -e "If you have any questions or if any issue is found, please make sure to report it at: ${UPURPLE}https://github.com/TuxTechLab/TuxTechLabWebsite/issues${NC}"
7474
}
7575

7676
# Function that writes and parses variables to write the new generated README.md file
@@ -153,7 +153,7 @@ By donating, you will help the development of this project, and *you will be fea
153153
154154
---
155155
156-
$PROJECT_NAME was generated from *[TuxTechLab/TuxTechLab-Template-Repo](https://github.com/TuxTechLab/TuxTechLab-Template-Repo)* 📚
156+
$PROJECT_NAME was generated from *[TuxTechLab/TuxTechLabWebsite](https://github.com/TuxTechLab/TuxTechLabWebsite
157157
158158
---
159159
@@ -205,6 +205,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
205205
206206
### Added
207207
208-
* The basic project structure from **[TuxTechLab/TuxTechLab-Template-Repo](https://github.com/TuxTechLab/TuxTechLab-Template-Repo)**.
208+
* The basic project structure from **[TuxTechLab/TuxTechLabWebsite](https://github.com/TuxTechLab/TuxTechLabWebsite)**.
209209
EOF"
210210
}

0 commit comments

Comments
 (0)