← スキル一覧に戻る

norminette-checker
by monedales
⭐ 1🍴 0📅 2026年1月22日
SKILL.md
name: norminette-checker description: Check and fix C code according to 42 School's Norminette standards. Use when checking code style, before committing, or when user mentions norm/norminette.
Norminette Checker
Automatically verify C code compliance with 42 School's Norminette standards.
Key Norminette Rules
File Structure
- Header: Standard 42 header required in all files
- Header Guards:
#ifndef,#define,#endifin .h files - Max Line Length: 80 characters (including newline)
- Max Function Length: 25 lines
- Functions per File: Maximum 5 functions
Formatting Rules
- Indentation: Tabs only (no spaces)
- Control Structure Braces:
if (condition) { // code on new line } - Function Braces:
int function(void) { // opening brace on new line } - Spaces:
- After keywords:
if (,while (,return - Around operators:
a + b,i = 0 - No space before semicolon
- After keywords:
Naming Conventions
- Functions:
ft_strlen,init_data(lowercase + underscore) - Variables:
last_meal_time,count(lowercase + underscore) - Macros:
MAX_PHILOS,BUFFER_SIZE(UPPERCASE) - Structs:
struct s_philo(prefixs_) - Typedefs:
t_philo,t_data(prefixt_)
Common Violations
- Line too long: Split at operators or function parameters
- Function too long: Extract logic into helper functions
- Too many functions: Split file into logical modules
- Mixed spaces/tabs: Use tabs only for indentation
- Missing newline at EOF: Add empty line at file end
- Multiple newlines: Remove extra blank lines
- Space before semicolon: Remove space
- Forbidden functions: Use only allowed functions per subject
Process
- Check files: Run
norminette *.c *.hornorminette -R CheckForbiddenSourceHeader - Read errors: Identify specific violations and line numbers
- Fix violations: Apply corrections following rules above
- Verify: Re-run norminette to confirm fixes
- Common fixes:
- Line length → break at logical points
- Function length → extract subfunctions
- Formatting → adjust braces/spaces
- Naming → rename to convention
Standard 42 Header Template
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* filename.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: login <login@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: YYYY/MM/DD HH:MM:SS by login #+# #+# */
/* Updated: YYYY/MM/DD HH:MM:SS by login ### ########.fr */
/* */
/* ************************************************************************** */
Quick Fixes
Line Too Long
// Before (83 chars)
printf("Philosopher %d has taken a fork and is now eating spaghetti\n", id);
// After (split string)
printf("Philosopher %d has taken a fork and is now eating "
"spaghetti\n", id);
Function Too Long
Extract repeated logic:
// Before: 30-line function
int process_data(t_data *data)
{
// validation (5 lines)
// processing (20 lines)
// cleanup (5 lines)
}
// After: split into helpers
int validate_data(t_data *data);
int process_logic(t_data *data);
int cleanup_data(t_data *data);
Check Command
# Check all files
norminette
# Check specific files
norminette src/*.c include/*.h
# Ignore header check (for testing)
norminette -R CheckDefine src/main.c
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です