diff --git a/.github/workflows/rubyzen-analysis.yml b/.github/workflows/rubyzen-analysis.yml index c8f0192..9091d20 100644 --- a/.github/workflows/rubyzen-analysis.yml +++ b/.github/workflows/rubyzen-analysis.yml @@ -12,10 +12,18 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Run RubyZen Analysis + - name: Run RubyZen Analysis (sample_project specs) uses: ./ with: token: ${{ secrets.GITHUB_TOKEN }} ruby-version: '3.3' target-directories: 'sample_project/src' target-rspec-directory: 'sample_project/spec' + + - name: Run RubyZen Analysis (top-level specs) + uses: ./ + with: + token: ${{ secrets.GITHUB_TOKEN }} + ruby-version: '3.3' + target-directories: 'src' + target-rspec-directory: 'spec' diff --git a/README.md b/README.md index a94919a..37e04d7 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,9 @@ bundle exec rspec sample_project/spec/ # Run custom lint rules for the target project bundle exec rspec target_project/spec/rubyzen/ + +# Run rspec on our custom matchers +bundle exec rspec spec ``` The lint rules are project-agnostic - you can apply any rule set to any target project by specifying the appropriate spec path. diff --git a/sample_project/spec/matchers/be_empty_matcher_spec.rb b/spec/matchers/be_empty_matcher_spec.rb similarity index 99% rename from sample_project/spec/matchers/be_empty_matcher_spec.rb rename to spec/matchers/be_empty_matcher_spec.rb index 0ca5730..21e3734 100644 --- a/sample_project/spec/matchers/be_empty_matcher_spec.rb +++ b/spec/matchers/be_empty_matcher_spec.rb @@ -104,4 +104,4 @@ def build_item(name:, class_name:, file_path:, line: 1) expect(matcher.failure_message).to include('Violations:') expect(matcher.failure_message).to include('Stale allowlist entries:') end -end \ No newline at end of file +end diff --git a/sample_project/spec/matchers/be_true_matcher_spec.rb b/spec/matchers/be_true_matcher_spec.rb similarity index 96% rename from sample_project/spec/matchers/be_true_matcher_spec.rb rename to spec/matchers/be_true_matcher_spec.rb index aa10a4d..62bad25 100644 --- a/sample_project/spec/matchers/be_true_matcher_spec.rb +++ b/spec/matchers/be_true_matcher_spec.rb @@ -3,7 +3,7 @@ require_relative '../spec_helper' RSpec.describe 'be_true' do - let(:test_item_class) { Struct.new(:name, :class_name, :file_path, :line, keyword_init: true) } + let(:test_item_class) { Struct.new(:name, :class_name, :file_path, :line, keyword_init: true) } let(:root_path) { File.expand_path('../..', __dir__) } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..dd69661 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require 'rubyzen'