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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5bc717030b6f075aebb0615a37ee45cf32aafe5cc7d5e9e7d5bbf50350f6cfa
4
- data.tar.gz: 6d03317e06b5d44b174b734424a72543943f5f62a39ff4d3cba9a6b1a64a9b0d
3
+ metadata.gz: f7ad132ec4853899869bcbcee2b1986cc727a68ee2c7c9195ac671dd867f446f
4
+ data.tar.gz: b277558ce497fe36c8e7d376b0a43e60a7e4ad370bed2969d6fc39c28d9e83bb
5
5
  SHA512:
6
- metadata.gz: a87d9aa67acfa4a3c5df1119d6c8aaa1e1f4ea98c8a923445cd970c1b783e3a25db0bae5f5b12950d61fc975ed75c6a1423ecf62ff5b31c3a81d16e9ce76428e
7
- data.tar.gz: 11a17aa329b2194b587e66d5e316e978c026dd2114795ce7dda1c95434e9bb037b981972625db420679de2df5eff66f6ccc26186891fb0b48d9facecdf7857b9
6
+ metadata.gz: 779e20d8e08352b85bce1abea1bed9e498889d88e2ed7776eded60e5708d7a53693bd13d0da52f31241e49813b6864802b4d4f2b2646c525851917568f8ea9f1
7
+ data.tar.gz: e6091b2d39561c3a10f8a13f883139450d8bc457a8b33e1349206183705067f86f595e4a6f5b500084e01e2bb02207f38f435e314c7602988a80a1a4d497360d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.0.3] - 2026-02-15
4
+
5
+ - exit with non-zero exit code if any violations are found
6
+
3
7
  ## [0.0.2] - 2026-02-15
4
8
 
5
9
  - MVP: Basic architecture enforcement with layered architecture support
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.
@@ -42,6 +42,8 @@ module Stellwerk
42
42
  end
43
43
 
44
44
  Stellwerk::Printer.new(violations).print
45
+
46
+ violations
45
47
  end
46
48
 
47
49
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stellwerk
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stellwerk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Theus