Skip to content

Commit a8db64c

Browse files
tbitcsoz-agent
andcommitted
feat: type-specific gitattributes (#39), gitignore expansion (#40), editorconfig (#43), Yocto/bitbake/markdown enhancements
gitattributes: 15 type-specific blocks (FPGA binary patterns, lock file linguist-generated, KiCad binary diff, Rust/Go/C/JS/TS/LaTeX/.NET/etc) gitignore: added missing blocks for data-ml, microservices, monorepo, browser-extension, spec-document, business/legal, api-specification. Enhanced FPGA (Vivado artifacts) and Yocto (image artifacts) blocks. editorconfig: new type-aware template with language-specific indent settings for all 30 project types. Yocto/bitbake: added .bbclass, .inc, .dts, .dtsi to language detection. Added kas.yml build system detection. Enhanced toolset with testimage and yocto-check-layer. Added bitbake, systemverilog, devicetree CI meta. Markdown: improved CI metadata with Python setup action for vale/mkdocs. Closes #39, closes #40, closes #43 Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent 325f135 commit a8db64c

6 files changed

Lines changed: 333 additions & 14 deletions

File tree

src/specsmith/importer.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
".yaml": "yaml",
3939
".bb": "bitbake",
4040
".bbappend": "bitbake",
41+
".bbclass": "bitbake",
42+
".inc": "bitbake",
43+
".dts": "devicetree",
44+
".dtsi": "devicetree",
4145
".proto": "protobuf",
4246
".graphql": "graphql",
4347
".gql": "graphql",
@@ -64,6 +68,7 @@
6468
"build.gradle.kts": "gradle",
6569
"meson.build": "meson",
6670
"bitbake": "bitbake",
71+
"kas.yml": "kas",
6772
"west.yml": "west",
6873
"pubspec.yaml": "flutter",
6974
"*.csproj": "dotnet",
@@ -752,7 +757,7 @@ def _infer_type(result: DetectionResult) -> ProjectType:
752757
# Hardware types
753758
if lang in ("vhdl", "verilog", "systemverilog"):
754759
return ProjectType.FPGA_RTL
755-
if lang == "bitbake" or build == "bitbake":
760+
if lang == "bitbake" or build in ("bitbake", "kas"):
756761
return ProjectType.YOCTO_BSP
757762

758763
# Language-specific

src/specsmith/scaffolder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def _build_file_map(config: ProjectConfig) -> list[tuple[str, str]]:
100100
("readme.md.j2", "README.md"),
101101
("gitignore.j2", ".gitignore"),
102102
("gitattributes.j2", ".gitattributes"),
103+
("editorconfig.j2", ".editorconfig"),
103104
# Modular governance
104105
("governance/rules.md.j2", "docs/governance/rules.md"),
105106
("governance/workflow.md.j2", "docs/governance/workflow.md"),
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# EditorConfig — https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
indent_style = space
10+
indent_size = 4
11+
{% if project.type.value in ('cli-python', 'library-python', 'backend-frontend', 'backend-frontend-tray', 'data-ml') %}
12+
13+
[*.py]
14+
indent_size = 4
15+
max_line_length = 100
16+
{% endif %}
17+
{% if project.type.value in ('cli-rust', 'library-rust') %}
18+
19+
[*.rs]
20+
indent_size = 4
21+
max_line_length = 100
22+
{% endif %}
23+
{% if project.type.value in ('cli-go',) %}
24+
25+
[*.go]
26+
indent_style = tab
27+
indent_size = 4
28+
{% endif %}
29+
{% if project.type.value in ('cli-c', 'library-c', 'embedded-hardware') %}
30+
31+
[*.{c,h,cpp,hpp}]
32+
indent_size = 4
33+
{% endif %}
34+
{% if project.type.value in ('web-frontend', 'fullstack-js', 'browser-extension', 'monorepo') %}
35+
36+
[*.{js,ts,jsx,tsx,css,scss,html}]
37+
indent_size = 2
38+
39+
[*.json]
40+
indent_size = 2
41+
{% endif %}
42+
{% if project.type.value == 'dotnet-app' %}
43+
44+
[*.cs]
45+
indent_size = 4
46+
47+
[*.csproj]
48+
indent_size = 2
49+
{% endif %}
50+
{% if project.type.value == 'fpga-rtl' %}
51+
52+
[*.{vhd,vhdl}]
53+
indent_size = 2
54+
55+
[*.{v,sv}]
56+
indent_size = 2
57+
58+
[*.{xdc,sdc,tcl}]
59+
indent_size = 2
60+
{% endif %}
61+
{% if project.type.value in ('yocto-bsp',) %}
62+
63+
[*.{bb,bbappend,bbclass,conf}]
64+
indent_size = 4
65+
66+
[*.{dts,dtsi}]
67+
indent_size = 4
68+
{% endif %}
69+
{% if project.type.value in ('research-paper',) %}
70+
71+
[*.{tex,bib}]
72+
indent_size = 2
73+
{% endif %}
74+
{% if project.type.value in ('devops-iac',) %}
75+
76+
[*.{tf,hcl,tfvars}]
77+
indent_size = 2
78+
{% endif %}
79+
80+
[*.{yml,yaml}]
81+
indent_size = 2
82+
83+
[*.md]
84+
trim_trailing_whitespace = false
85+
86+
[Makefile]
87+
indent_style = tab
88+
89+
[*.{cmd,bat}]
90+
end_of_line = crlf
91+
92+
[*.{ps1,psm1}]
93+
end_of_line = crlf
Lines changed: 140 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,146 @@
1+
# Auto-detect text files and normalize line endings
12
* text=auto
2-
*.py text eol=lf
3-
*.pyi text eol=lf
4-
*.sh text eol=lf
5-
*.bash text eol=lf
6-
*.ps1 text eol=crlf
7-
*.psm1 text eol=crlf
8-
*.toml text eol=lf
9-
*.cfg text eol=lf
3+
4+
# Common text files
5+
*.md text eol=lf
6+
*.txt text eol=lf
107
*.yml text eol=lf
118
*.yaml text eol=lf
129
*.json text eol=lf
13-
*.md text eol=lf
10+
*.toml text eol=lf
11+
*.cfg text eol=lf
12+
*.ini text eol=lf
13+
*.xml text eol=lf
1414
.gitignore text eol=lf
1515
.gitattributes text eol=lf
16+
.editorconfig text eol=lf
17+
18+
# Shell scripts
19+
*.sh text eol=lf
20+
*.bash text eol=lf
21+
*.cmd text eol=crlf
22+
*.bat text eol=crlf
23+
*.ps1 text eol=crlf
24+
*.psm1 text eol=crlf
25+
{% if project.type.value in ('cli-python', 'library-python', 'backend-frontend', 'backend-frontend-tray', 'data-ml') %}
26+
27+
# Python
28+
*.py text eol=lf
29+
*.pyi text eol=lf
30+
*.pyx text eol=lf
31+
{% endif %}
32+
{% if project.type.value in ('cli-rust', 'library-rust') %}
33+
34+
# Rust
35+
*.rs text eol=lf
36+
Cargo.lock text -diff linguist-generated
37+
{% endif %}
38+
{% if project.type.value in ('cli-go',) %}
39+
40+
# Go
41+
*.go text eol=lf
42+
go.sum text -diff linguist-generated
43+
{% endif %}
44+
{% if project.type.value in ('cli-c', 'library-c', 'embedded-hardware') %}
45+
46+
# C / C++
47+
*.c text eol=lf
48+
*.h text eol=lf
49+
*.cpp text eol=lf
50+
*.hpp text eol=lf
51+
*.o binary
52+
*.a binary
53+
*.so binary
54+
*.dll binary
55+
{% endif %}
56+
{% if project.type.value in ('web-frontend', 'fullstack-js', 'browser-extension', 'monorepo') %}
57+
58+
# JavaScript / TypeScript
59+
*.js text eol=lf
60+
*.ts text eol=lf
61+
*.jsx text eol=lf
62+
*.tsx text eol=lf
63+
*.css text eol=lf
64+
*.scss text eol=lf
65+
*.html text eol=lf
66+
package-lock.json text -diff linguist-generated
67+
yarn.lock text -diff linguist-generated
68+
pnpm-lock.yaml text -diff linguist-generated
69+
{% endif %}
70+
{% if project.type.value == 'dotnet-app' %}
71+
72+
# .NET
73+
*.cs text eol=lf
74+
*.csproj text eol=lf
75+
*.sln text eol=crlf
76+
*.dll binary
77+
*.exe binary
78+
{% endif %}
79+
{% if project.type.value == 'fpga-rtl' %}
80+
81+
# FPGA / RTL
82+
*.vhd text eol=lf
83+
*.vhdl text eol=lf
84+
*.v text eol=lf
85+
*.sv text eol=lf
86+
*.xdc text eol=lf
87+
*.sdc text eol=lf
88+
*.tcl text eol=lf
89+
*.bit binary
90+
*.bin binary
91+
*.xsa binary
92+
*.ltx binary
93+
*.mmi binary
94+
{% endif %}
95+
{% if project.type.value in ('yocto-bsp',) %}
96+
97+
# Yocto / BitBake
98+
*.bb text eol=lf
99+
*.bbappend text eol=lf
100+
*.bbclass text eol=lf
101+
*.conf text eol=lf
102+
*.dts text eol=lf
103+
*.dtsi text eol=lf
104+
{% endif %}
105+
{% if project.type.value == 'pcb-hardware' %}
106+
107+
# KiCad / PCB
108+
*.kicad_pcb binary diff
109+
*.kicad_sch binary diff
110+
*.kicad_pro text eol=lf
111+
*.step binary
112+
*.wrl binary
113+
{% endif %}
114+
{% if project.type.value == 'research-paper' %}
115+
116+
# LaTeX
117+
*.tex text eol=lf
118+
*.bib text eol=lf
119+
*.cls text eol=lf
120+
*.sty text eol=lf
121+
*.pdf binary
122+
*.eps binary
123+
{% endif %}
124+
{% if project.type.value == 'api-specification' %}
125+
126+
# API / Protobuf
127+
*.proto text eol=lf
128+
*.graphql text eol=lf
129+
{% endif %}
130+
{% if project.type.value == 'mobile-app' %}
131+
132+
# Mobile
133+
*.swift text eol=lf
134+
*.kt text eol=lf
135+
*.dart text eol=lf
136+
*.apk binary
137+
*.aab binary
138+
*.ipa binary
139+
{% endif %}
140+
{% if project.type.value == 'devops-iac' %}
141+
142+
# Terraform / IaC
143+
*.tf text eol=lf
144+
*.tfvars text eol=lf
145+
*.hcl text eol=lf
146+
{% endif %}

src/specsmith/templates/gitignore.j2

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,32 @@ fp-info-cache
8686
# FPGA
8787
*.jou
8888
*.str
89+
*.bit
90+
*.bin
91+
*.xsa
92+
*.ltx
93+
*.mmi
8994
work/
9095
xsim.dir/
96+
.Xil/
97+
dfx_runtime.txt
98+
*.backup.log
99+
*.backup.jou
91100
{% endif %}
92101
{% if project.type.value in ('yocto-bsp', 'embedded-hardware') %}
93102

94-
# Embedded
103+
# Yocto / Embedded
95104
twister-out/
96105
sstate-cache/
97106
downloads/
98107
tmp/
108+
*.wic
109+
*.wic.xz
110+
*.wic.bmap
111+
*.ext4
112+
*.manifest
113+
*.tar.gz
114+
cache/
99115
{% endif %}
100116
{% if project.type.value == 'research-paper' %}
101117

@@ -117,3 +133,57 @@ tmp/
117133
*.tfstate.backup
118134
*.tfvars
119135
{% endif %}
136+
{% if project.type.value == 'data-ml' %}
137+
138+
# Data / ML
139+
.ipynb_checkpoints/
140+
mlruns/
141+
wandb/
142+
data/raw/
143+
models/*.pkl
144+
models/*.h5
145+
models/*.pt
146+
*.onnx
147+
{% endif %}
148+
{% if project.type.value == 'microservices' %}
149+
150+
# Microservices
151+
.env
152+
.env.*
153+
!.env.example
154+
docker-compose.override.yml
155+
{% endif %}
156+
{% if project.type.value in ('monorepo',) %}
157+
158+
# Monorepo
159+
.turbo/
160+
.nx/
161+
{% endif %}
162+
{% if project.type.value == 'browser-extension' %}
163+
164+
# Browser Extension
165+
web-ext-artifacts/
166+
*.crx
167+
*.xpi
168+
{% endif %}
169+
{% if project.type.value in ('spec-document', 'user-manual') %}
170+
171+
# Documentation builds
172+
_site/
173+
site/
174+
_build/
175+
.cache/
176+
public/
177+
{% endif %}
178+
{% if project.type.value in ('business-plan', 'legal-compliance', 'patent-application') %}
179+
180+
# Office / Documents
181+
~$*
182+
*.tmp
183+
*.bak
184+
{% endif %}
185+
{% if project.type.value == 'api-specification' %}
186+
187+
# API / Generated
188+
generated/
189+
{% endif %}

0 commit comments

Comments
 (0)