stellwerk 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +20 -0
- data/lib/stellwerk/commands/check.rb +2 -0
- data/lib/stellwerk/version.rb +1 -1
- data/lib/tasks/stellwerk.rake +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f7ad132ec4853899869bcbcee2b1986cc727a68ee2c7c9195ac671dd867f446f
|
|
4
|
+
data.tar.gz: b277558ce497fe36c8e7d376b0a43e60a7e4ad370bed2969d6fc39c28d9e83bb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 779e20d8e08352b85bce1abea1bed9e498889d88e2ed7776eded60e5708d7a53693bd13d0da52f31241e49813b6864802b4d4f2b2646c525851917568f8ea9f1
|
|
7
|
+
data.tar.gz: e6091b2d39561c3a10f8a13f883139450d8bc457a8b33e1349206183705067f86f595e4a6f5b500084e01e2bb02207f38f435e314c7602988a80a1a4d497360d
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -22,6 +22,8 @@ gem install stellwerk
|
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
|
+
Create a `stellwerk.yml` in the root of your Rails application that defines at least one [rule](#rules).
|
|
26
|
+
|
|
25
27
|
Run the check task in your Rails app:
|
|
26
28
|
|
|
27
29
|
```bash
|
|
@@ -34,6 +36,24 @@ Run a simpler check without booting `:environment` (uses statically defined Zeit
|
|
|
34
36
|
bin/rails stellwerk:check_simple
|
|
35
37
|
```
|
|
36
38
|
|
|
39
|
+
### Rules
|
|
40
|
+
|
|
41
|
+
Rules are defined in the `stellwerk.yml` file.
|
|
42
|
+
|
|
43
|
+
#### Layered Architecture
|
|
44
|
+
|
|
45
|
+
The Layered Architecture rule enforces that files in one layer do not reference files in a layer that is "above" it.
|
|
46
|
+
|
|
47
|
+
Example configuration with three layers:
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
rules:
|
|
51
|
+
layers:
|
|
52
|
+
- app/controllers
|
|
53
|
+
- [ app/jobs, app/models ]
|
|
54
|
+
- lib
|
|
55
|
+
```
|
|
56
|
+
|
|
37
57
|
## Development
|
|
38
58
|
|
|
39
59
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/stellwerk/version.rb
CHANGED
data/lib/tasks/stellwerk.rake
CHANGED
|
@@ -4,10 +4,14 @@ namespace :stellwerk do
|
|
|
4
4
|
task check: :environment do
|
|
5
5
|
autoloaders = [Rails.autoloaders.main, Rails.autoloaders.once].compact
|
|
6
6
|
|
|
7
|
-
Stellwerk::Commands::Check.new(Rails.root, autoloaders: autoloaders).run
|
|
7
|
+
violations = Stellwerk::Commands::Check.new(Rails.root, autoloaders: autoloaders).run
|
|
8
|
+
|
|
9
|
+
exit 1 if violations.any?
|
|
8
10
|
end
|
|
9
11
|
|
|
10
12
|
task :check_simple do
|
|
11
|
-
Stellwerk::Commands::Check.new(Dir.pwd).run
|
|
13
|
+
violations = Stellwerk::Commands::Check.new(Dir.pwd).run
|
|
14
|
+
|
|
15
|
+
exit 1 if violations.any?
|
|
12
16
|
end
|
|
13
17
|
end
|