Skip to content

Commit ba7feea

Browse files
committed
tooling: Add external config files and Makefile targets.
1 parent 3761702 commit ba7feea

8 files changed

Lines changed: 8657 additions & 1013 deletions

.prettierrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"endOfLine": "lf",
3+
"semi": true,
4+
"singleQuote": true,
5+
"tabWidth": 4,
6+
"arrowParens": "avoid",
7+
"trailingComma": "all",
8+
"useTabs": false
9+
}

.releaserc.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"branches": ["main"],
3+
"repositoryUrl": "https://github.com/steamicc/micropython-steami-lib.git",
4+
"debug": "false",
5+
"plugins": [
6+
"@semantic-release/commit-analyzer",
7+
"@semantic-release/release-notes-generator",
8+
[
9+
"@semantic-release/changelog",
10+
{
11+
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines."
12+
}
13+
],
14+
[
15+
"@semantic-release/github",
16+
{
17+
"assets": "pack/*.tgz"
18+
}
19+
],
20+
[
21+
"@semantic-release/git",
22+
{
23+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
24+
}
25+
]
26+
]
27+
}

.validate-branch-namerc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
pattern: "^(main)$|^(feat|fix|docs|tooling|ci|test|style|chore|refactor)\/([a-z0-9]+-)*[a-z0-9]+$|^release\/v([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-z0-9-]*)$",
3+
errorMsg: "🤨 La branche que tu essaies de pusher ne respecte pas nos conventions, tu peux la renommer avec `git branch -m <nom-actuel> <nouveau-nom>`",
4+
}

Makefile

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22

33
PORT ?= /dev/ttyACM0
44

5-
# --- Development setup ---
5+
# --- Setup ---
6+
7+
.PHONY: prepare
8+
prepare: ## Install git hooks
9+
husky
10+
11+
.PHONY: setup
12+
setup: install prepare ## Full dev environment setup
613

714
.PHONY: install
8-
install: ## Install dev tools and git hooks
15+
install: ## Install dev tools (pip + npm)
916
pip install ruff pytest
1017
npm install
1118

@@ -41,6 +48,20 @@ test-driver: ## Run tests for one driver (usage: make test-driver DRIVER=hts221)
4148
test-examples: ## Validate all example files (syntax + imports)
4249
python3 -m pytest tests/test_examples.py -v
4350

51+
# --- CI ---
52+
53+
.PHONY: ci
54+
ci: lint test test-examples ## Run all CI checks (lint + tests + examples)
55+
56+
# --- Build / Package ---
57+
58+
.PHONY: build
59+
build: lint test ## Build (lint + test)
60+
61+
.PHONY: package
62+
package: ## Package drivers for distribution
63+
@echo "Packaging not yet implemented (see issue backlog)"
64+
4465
# --- Hardware ---
4566

4667
.PHONY: repl

commitlint.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
module.exports = {
22
extends: ['@commitlint/config-conventional'],
3+
parserPreset: {
4+
parserOpts: {
5+
issuePrefixes: ['#'],
6+
},
7+
},
38
rules: {
49
'subject-case': [0],
510
'subject-full-stop': [0],

git-precommit-checks.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
display: {
3+
notifications: true,
4+
offendingContent: true,
5+
rulesSummary: false,
6+
shortStats: true,
7+
verbose: false,
8+
},
9+
rules: [
10+
{
11+
message: 'Aurais-tu oublié de terminer certaines tâches ? Aurais-tu une issue à ouvrir pour traiter cette tache plus tard ?',
12+
nonBlocking: true,
13+
regex: /(?:FIXME|TODO)/,
14+
},
15+
{
16+
message: 'Tu as des marqueurs de conflits qui traînent dans ton code',
17+
regex: /^[<>|=]{4,}/m,
18+
},
19+
{
20+
message:
21+
'Arrêt du commit : tu as renseigné des choses qui ne doivent pas être commitées !',
22+
regex: /do[\s]not[\s]commit/i,
23+
},
24+
{
25+
filter: /\.js$/,
26+
message: '🤔 Hum ! N’as-tu pas oublié de retirer du "console.log(…)" ?',
27+
nonBlocking: true,
28+
regex: /^\s*console\.log/,
29+
},
30+
],
31+
}

0 commit comments

Comments
 (0)