breadkit-lint 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.yamllint +16 -0
  3. data/CHANGELOG.md +30 -2
  4. data/README.md +55 -40
  5. data/action.yml +42 -0
  6. data/config/default.yml +33 -0
  7. data/docs/REFERENCE.md +129 -0
  8. data/docs/rules/Electrical/CapacitorVoltageRating.md +5 -0
  9. data/docs/rules/Electrical/FloatingInput.md +11 -0
  10. data/docs/rules/Electrical/GpioOvercurrent.md +18 -0
  11. data/docs/rules/Electrical/I2CAddressConflict.md +5 -0
  12. data/docs/rules/Electrical/I2CPullupMissing.md +5 -0
  13. data/docs/rules/Electrical/LedOvercurrent.md +5 -0
  14. data/docs/rules/Electrical/MinimumResistance.md +14 -0
  15. data/docs/rules/Electrical/MissingBaseResistor.md +5 -0
  16. data/docs/rules/Electrical/MissingDecouplingCapacitor.md +5 -0
  17. data/docs/rules/Electrical/MissingFlybackDiode.md +18 -0
  18. data/docs/rules/Electrical/MissingPullResistor.md +17 -0
  19. data/docs/rules/Electrical/MissingSeriesResistor.md +3 -1
  20. data/docs/rules/Electrical/NoCommonGround.md +1 -0
  21. data/docs/rules/Electrical/RailPolarityMismatch.md +10 -0
  22. data/docs/rules/Electrical/ResistorPowerRating.md +5 -0
  23. data/docs/rules/Electrical/ReversePolarity.md +1 -1
  24. data/docs/rules/Electrical/SupplyOverload.md +11 -0
  25. data/docs/rules/Electrical/SupplyVoltageRange.md +1 -0
  26. data/docs/rules/Electrical/VoltageDomainMismatch.md +6 -0
  27. data/docs/rules/Intent/ConnectionMismatch.md +3 -1
  28. data/docs/rules/Intent/MeasurementUnavailable.md +10 -0
  29. data/docs/rules/Layout/AmbiguousSupplySource.md +5 -0
  30. data/docs/rules/Layout/BodyOverlap.md +11 -0
  31. data/docs/rules/Layout/HoleCovered.md +11 -0
  32. data/docs/rules/Layout/InvalidColor.md +3 -0
  33. data/docs/rules/Layout/InvalidOption.md +3 -0
  34. data/docs/rules/Layout/InvalidRoute.md +3 -0
  35. data/docs/rules/Layout/InvalidValue.md +3 -0
  36. data/docs/rules/Layout/InvalidWireId.md +3 -0
  37. data/docs/rules/Layout/LeadSpan.md +21 -0
  38. data/docs/rules/Layout/PartOverride.md +3 -0
  39. data/docs/rules/Layout/UnknownSupplySource.md +5 -0
  40. data/docs/rules/Layout/UnmatchedParts.md +3 -0
  41. data/docs/rules/Layout/WireOverIC.md +11 -0
  42. data/docs/rules/Lint/RedundantDisable.md +3 -0
  43. data/docs/rules/Lint/UnknownRuleInDisable.md +5 -0
  44. data/lib/breadkit/lint/baseline.rb +38 -0
  45. data/lib/breadkit/lint/rake_task.rb +22 -0
  46. data/lib/breadkit/lint/rules/electrical.rb +580 -30
  47. data/lib/breadkit/lint/rules/intent.rb +69 -4
  48. data/lib/breadkit/lint/rules/layout.rb +148 -0
  49. data/lib/breadkit/lint/rules/style.rb +36 -7
  50. data/lib/breadkit/lint/rules/support.rb +45 -11
  51. data/lib/breadkit/lint/rules.rb +205 -2
  52. data/lib/breadkit/lint/source_editor.rb +138 -0
  53. data/lib/breadkit/lint/version.rb +1 -1
  54. data/lib/breadkit/lint.rb +422 -59
  55. data/lib/guard/breadkit/templates/Guardfile +7 -0
  56. data/lib/guard/breadkit.rb +26 -0
  57. data/locales/en.yml +82 -0
  58. data/locales/ja.yml +130 -4
  59. data/locales/ko.yml +191 -0
  60. data/locales/zh.yml +191 -0
  61. data/package-lock.json +103 -0
  62. data/package.json +2 -1
  63. data/scripts/action-run.sh +51 -0
  64. data/scripts/build-rule-pages.mjs +87 -0
  65. data/scripts/check-rule-pages.mjs +18 -0
  66. data/scripts/pre-commit +24 -0
  67. data/sig/breadkit/lint.rbs +12 -1
  68. data/site/index.html +9 -6
  69. data/site/schemas/lint-v1.json +71 -0
  70. data/site/styles.css +13 -0
  71. metadata +64 -4
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://breadkit.github.io/breadkit-lint/schemas/lint-v1.json",
4
+ "title": "Breadkit lint report v1",
5
+ "type": "object",
6
+ "required": ["schema_version", "tool", "files", "summary"],
7
+ "properties": {
8
+ "schema_version": {"const": 1},
9
+ "tool": {
10
+ "type": "object",
11
+ "required": ["name", "version"],
12
+ "properties": {"name": {"const": "bklint"}, "version": {"type": "string"}}
13
+ },
14
+ "files": {
15
+ "type": "array",
16
+ "items": {
17
+ "type": "object",
18
+ "required": ["path", "analysis_skipped", "offenses"],
19
+ "properties": {
20
+ "path": {"type": "string"},
21
+ "analysis_skipped": {"type": "boolean"},
22
+ "offenses": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "object",
26
+ "required": ["rule", "severity", "message", "location", "state", "targets"],
27
+ "properties": {
28
+ "rule": {"type": "string"},
29
+ "severity": {"enum": ["error", "warning", "info"]},
30
+ "message": {"type": "string"},
31
+ "docs_url": {"type": ["string", "null"], "format": "uri"},
32
+ "suggestion": {"type": ["string", "null"]},
33
+ "location": {
34
+ "type": "object",
35
+ "required": ["path", "line"],
36
+ "properties": {
37
+ "path": {"type": "string"},
38
+ "line": {"type": ["integer", "null"], "minimum": 1},
39
+ "column": {"type": "integer", "minimum": 1}
40
+ }
41
+ },
42
+ "state": {"type": ["string", "null"]},
43
+ "targets": {
44
+ "type": "object",
45
+ "properties": {
46
+ "components": {"$ref": "#/$defs/identifiers"},
47
+ "pins": {"$ref": "#/$defs/identifiers"},
48
+ "holes": {"$ref": "#/$defs/identifiers"},
49
+ "wires": {"$ref": "#/$defs/identifiers"},
50
+ "nets": {"$ref": "#/$defs/identifiers"}
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+ },
59
+ "summary": {
60
+ "type": "object",
61
+ "required": ["files", "errors", "warnings", "infos"],
62
+ "properties": {
63
+ "files": {"type": "integer", "minimum": 0},
64
+ "errors": {"type": "integer", "minimum": 0},
65
+ "warnings": {"type": "integer", "minimum": 0},
66
+ "infos": {"type": "integer", "minimum": 0}
67
+ }
68
+ }
69
+ },
70
+ "$defs": {"identifiers": {"type": "array", "items": {"type": "string"}}}
71
+ }
data/site/styles.css CHANGED
@@ -1,6 +1,7 @@
1
1
  @import "tailwindcss";
2
2
 
3
3
  @source "./**/*.html";
4
+ @source "../_site/rules/**/*.html";
4
5
 
5
6
  @theme {
6
7
  --color-ink: #101719;
@@ -12,3 +13,15 @@
12
13
  --font-sans: "Avenir Next", Avenir, ui-sans-serif, system-ui, sans-serif;
13
14
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
14
15
  }
16
+
17
+ .rule-doc { max-width: 72ch; line-height: 1.75; color: var(--color-muted); }
18
+ .rule-doc h1 { margin-bottom: 1.5rem; color: var(--color-paper); font-size: clamp(1.875rem, 4vw, 2.75rem); font-weight: 600; line-height: 1.2; text-wrap: balance; }
19
+ .rule-doc h2 { margin: 2.25rem 0 .75rem; color: var(--color-paper); font-size: 1.4rem; font-weight: 600; }
20
+ .rule-doc p, .rule-doc ul, .rule-doc ol, .rule-doc pre { margin-top: 1rem; }
21
+ .rule-doc ul, .rule-doc ol { padding-left: 1.5rem; }
22
+ .rule-doc ul { list-style: disc; }
23
+ .rule-doc ol { list-style: decimal; }
24
+ .rule-doc a { color: var(--color-paper); text-decoration: underline; text-decoration-color: var(--color-copper); text-underline-offset: .25rem; }
25
+ .rule-doc :not(pre) > code, .rule-summary code { color: var(--color-paper); font-family: var(--font-mono); }
26
+ .rule-doc pre { overflow-x: auto; border: 1px solid var(--color-line); border-radius: .5rem; background: var(--color-board); padding: 1.25rem; color: var(--color-paper); font-family: var(--font-mono); font-size: .875rem; line-height: 1.6; }
27
+ .rule-summary { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breadkit-lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yudai Takada
@@ -15,14 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.1.0
18
+ version: 0.2.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 0.1.0
25
+ version: 0.2.0
26
+ - !ruby/object:Gem::Dependency
27
+ name: prism
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.9'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.9'
26
40
  description: bklint analyzes Breadkit circuits and reports layout, electrical, and
27
41
  intent offenses.
28
42
  email:
@@ -32,55 +46,101 @@ executables:
32
46
  extensions: []
33
47
  extra_rdoc_files: []
34
48
  files:
49
+ - ".yamllint"
35
50
  - CHANGELOG.md
36
51
  - LICENSE.txt
37
52
  - README.md
38
53
  - SECURITY.md
54
+ - action.yml
39
55
  - config/default.yml
56
+ - docs/REFERENCE.md
57
+ - docs/rules/Electrical/CapacitorVoltageRating.md
40
58
  - docs/rules/Electrical/DanglingWire.md
59
+ - docs/rules/Electrical/FloatingInput.md
41
60
  - docs/rules/Electrical/FloatingPin.md
61
+ - docs/rules/Electrical/GpioOvercurrent.md
62
+ - docs/rules/Electrical/I2CAddressConflict.md
63
+ - docs/rules/Electrical/I2CPullupMissing.md
64
+ - docs/rules/Electrical/LedOvercurrent.md
65
+ - docs/rules/Electrical/MinimumResistance.md
66
+ - docs/rules/Electrical/MissingBaseResistor.md
67
+ - docs/rules/Electrical/MissingDecouplingCapacitor.md
68
+ - docs/rules/Electrical/MissingFlybackDiode.md
69
+ - docs/rules/Electrical/MissingPullResistor.md
42
70
  - docs/rules/Electrical/MissingSeriesResistor.md
43
71
  - docs/rules/Electrical/NetLabelConflict.md
44
72
  - docs/rules/Electrical/NoCommonGround.md
45
73
  - docs/rules/Electrical/PowerPinUnconnected.md
74
+ - docs/rules/Electrical/RailPolarityMismatch.md
75
+ - docs/rules/Electrical/ResistorPowerRating.md
46
76
  - docs/rules/Electrical/ReversePolarity.md
47
77
  - docs/rules/Electrical/ShortCircuit.md
48
78
  - docs/rules/Electrical/ShortedComponent.md
49
79
  - docs/rules/Electrical/SplitRail.md
80
+ - docs/rules/Electrical/SupplyOverload.md
50
81
  - docs/rules/Electrical/SupplyVoltageRange.md
82
+ - docs/rules/Electrical/VoltageDomainMismatch.md
51
83
  - docs/rules/Intent/ConnectionMismatch.md
84
+ - docs/rules/Intent/MeasurementUnavailable.md
52
85
  - docs/rules/Intent/UnknownNet.md
86
+ - docs/rules/Layout/AmbiguousSupplySource.md
87
+ - docs/rules/Layout/BodyOverlap.md
53
88
  - docs/rules/Layout/DuplicateRef.md
54
89
  - docs/rules/Layout/HoleConflict.md
90
+ - docs/rules/Layout/HoleCovered.md
91
+ - docs/rules/Layout/InvalidColor.md
55
92
  - docs/rules/Layout/InvalidHole.md
93
+ - docs/rules/Layout/InvalidOption.md
56
94
  - docs/rules/Layout/InvalidPlacement.md
95
+ - docs/rules/Layout/InvalidRoute.md
96
+ - docs/rules/Layout/InvalidValue.md
97
+ - docs/rules/Layout/InvalidWireId.md
98
+ - docs/rules/Layout/LeadSpan.md
57
99
  - docs/rules/Layout/NoFreeHole.md
100
+ - docs/rules/Layout/PartOverride.md
58
101
  - docs/rules/Layout/PinsInSameStrip.md
59
102
  - docs/rules/Layout/SplitNetLabel.md
60
103
  - docs/rules/Layout/UnknownBoard.md
61
104
  - docs/rules/Layout/UnknownOption.md
62
105
  - docs/rules/Layout/UnknownPart.md
63
106
  - docs/rules/Layout/UnknownPin.md
107
+ - docs/rules/Layout/UnknownSupplySource.md
64
108
  - docs/rules/Layout/UnknownTransistorModel.md
109
+ - docs/rules/Layout/UnmatchedParts.md
65
110
  - docs/rules/Layout/UnplacedPin.md
111
+ - docs/rules/Layout/WireOverIC.md
112
+ - docs/rules/Lint/RedundantDisable.md
113
+ - docs/rules/Lint/UnknownRuleInDisable.md
66
114
  - docs/rules/Style/WireColor.md
67
115
  - exe/bklint
68
116
  - lib/breadkit/lint.rb
117
+ - lib/breadkit/lint/baseline.rb
118
+ - lib/breadkit/lint/rake_task.rb
69
119
  - lib/breadkit/lint/rules.rb
70
120
  - lib/breadkit/lint/rules/electrical.rb
71
121
  - lib/breadkit/lint/rules/intent.rb
72
122
  - lib/breadkit/lint/rules/layout.rb
73
123
  - lib/breadkit/lint/rules/style.rb
74
124
  - lib/breadkit/lint/rules/support.rb
125
+ - lib/breadkit/lint/source_editor.rb
75
126
  - lib/breadkit/lint/version.rb
127
+ - lib/guard/breadkit.rb
128
+ - lib/guard/breadkit/templates/Guardfile
76
129
  - locales/en.yml
77
130
  - locales/ja.yml
131
+ - locales/ko.yml
132
+ - locales/zh.yml
78
133
  - package-lock.json
79
134
  - package.json
135
+ - scripts/action-run.sh
136
+ - scripts/build-rule-pages.mjs
137
+ - scripts/check-rule-pages.mjs
80
138
  - scripts/check_bad_examples.rb
139
+ - scripts/pre-commit
81
140
  - sig/breadkit/lint.rbs
82
141
  - site/favicon.svg
83
142
  - site/index.html
143
+ - site/schemas/lint-v1.json
84
144
  - site/styles.css
85
145
  homepage: https://github.com/breadkit/breadkit-lint
86
146
  licenses:
@@ -105,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
165
  - !ruby/object:Gem::Version
106
166
  version: '0'
107
167
  requirements: []
108
- rubygems_version: 4.0.16
168
+ rubygems_version: 4.0.20
109
169
  specification_version: 4
110
170
  summary: Check breadboard wiring designs for common layout and circuit errors.
111
171
  test_files: []