archspec 0.3.0 → 0.5.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.
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ArchSpec
4
- module Presets
5
- module_function
6
-
7
- def apply(name, dsl, **options)
8
- Architectures.apply(name, dsl, **options)
9
- end
10
- end
11
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ArchSpec
4
- module Rules
5
- class ZeitwerkNamingRule
6
- def id
7
- 'zeitwerk.naming'
8
- end
9
-
10
- def evaluate(graph)
11
- graph.files.values.filter_map do |file|
12
- next unless file.expected_constant
13
-
14
- defined = graph.constants_for_path(file.path).map(&:name)
15
- next if defined.include?(file.expected_constant)
16
-
17
- Diagnostic.new(
18
- rule: id,
19
- message: "#{file.relative_path} should define #{file.expected_constant}",
20
- location: SourceLocation.new(file.path, 1, 1),
21
- evidence: "defined constants: #{defined.empty? ? '(none)' : defined.join(', ')}"
22
- )
23
- end
24
- end
25
- end
26
- end
27
- end