Skip to content

fix: Resolve baseline file paths against the base path, not the working directory - #549

Merged
samsonasik merged 2 commits into
mainfrom
baseline-path
Nov 8, 2026
Merged

samsonasik merged 2 commits into
mainfrom
baseline-path

Conversation

@samsonasik

@samsonasik samsonasik commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Given:

acme/                          ← CI working directory
β”œβ”€β”€ src/
β”‚   └── Kernel.php             ← root app
└── packages/
    └── billing/
        β”œβ”€β”€ structarmed.php    ← ->baseline('structarmed-baseline.php')
        β”œβ”€β”€ structarmed-baseline.php
        └── src/
            └── Kernel.php     ← baselined violation

and generated structarmed-baseline.php:

[
    'rule' => 'source.must_be_final',
    'message' => 'Class [Acme\Billing\Kernel] must be declared final',
    'file' => 'src/Kernel.php',
    // ...
],

Then CI run from the root:

vendor/bin/structarmed analyse \
    --basepath=packages/billing \
    --config=packages/billing/structarmed.php

Before

βœ—  [source.must_be_final]
   Class [Acme\Billing\Kernel] must be declared final
   β†’ /acme/packages/billing/src/Kernel.php:5

1 violation(s) found

After

βœ…  No violations found.

@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.

πŸ“’ Thoughts on this report? Let us know!

@samsonasik
samsonasik merged commit 01956d4 into main Nov 8, 2026
14 checks passed
@samsonasik
samsonasik deleted the baseline-path branch November 8, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant