Skip to content

Allow Skunk to generate reports in a given path with the --out flag - #131

Merged
JuanVqz merged 11 commits into
mainfrom
feat/cli-out-path-root
Oct 12, 2026
Merged

JuanVqz merged 11 commits into
mainfrom
feat/cli-out-path-root

Conversation

@JuanVqz

@JuanVqz JuanVqz commented Nov 14, 2025 •

Copy link
Copy Markdown
Member

IMPORTANT: Please read the README before submitting pull requests for this project. Additionally, if your PR closes any open GitHub issue, make sure you include Closes #XXXX in your comment.

  • Add an entry to CHANGELOG.md that links to this PR under the "main (unreleased)" heading.

Description:

This is a breaking change: -o/--out used to take a file name and append the status and share messages to it. It now takes the directory where Skunk writes its reports.

  • skunk --out reports -f console,json,html writes reports/skunk_report.txt, reports/skunk_report.json and reports/skunk_report.html. The HTML report is renamed from skunk_overview.html to skunk_report.html so the three formats share one name.
  • Without --out, nothing moves: JSON and HTML go to RubyCritic's root (tmp/rubycritic, or the path set in .rubycritic.yml), and the console report is only printed, as before.
  • Skunk extends RubyCritic's convention instead of reusing its setting: --out sets Skunk::Config.root, which falls back to RubyCritic::Config.root when --out is not given. RubyCritic's own root is left alone, so Skunk's reports can live somewhere else than RubyCritic's.
  • Compare mode (skunk -b main --out reports) writes build_details.txt to reports/compare/. RubyCritic's own build_number.txt stays under RubyCritic's root.
  • --out rejects a path that is an existing file, so an old -o skunk_report.txt call against an existing report fails with a clear error. It also rejects an empty path. Both exit 1.
  • Also in this PR: RuboCop is pinned to ~> 1.81.0 on Ruby 3.1 and up so CI lints against one version. Older rubies skip the lint task and still run the tests and reek.

I will abide by the code of conduct.

@JuanVqz
JuanVqz force-pushed the feat/cli-out-path-root branch from 65f04b5 to 1411dcc Compare November 17, 2025 22:13
Base automatically changed from feat/cli-multi-out-formats to main February 6, 2026 01:12
@JuanVqz
JuanVqz force-pushed the feat/cli-out-path-root branch from 1411dcc to 23da5f1 Compare February 6, 2026 05:27
@JuanVqz

JuanVqz commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

I had forgotten about this PR, I'll try to do my best to get back to it.

Update rubocop todo file with latest offense counts and configurations
…rinting

Move output path configuration to Skunk::Config and remove file output logic from Application#print
Update tests and documentation to reflect changes in output path handling

Even if the default path where the JSON and HTML reports are generated are `tmp/rubycritic` you can now modify them.
- Write reporter output with $stdout.puts directly instead of a private
  print wrapper in the application
- Memoize the SHARE_URL lookups in StatusSharer and use String#empty?
- Simplify Skunk::Config#root= now that to_s covers the nil case
- Assert the default root against an explicit RubyCritic::Config.root
  instead of a path regex, restoring the prior value afterwards
@JuanVqz
JuanVqz force-pushed the feat/cli-out-path-root branch from 23da5f1 to b66b365 Compare September 8, 2026 17:19
RuboCop derives TargetRubyVersion from the gemspec's
required_ruby_version (>= 2.4.0), so a begin/ensure spanning the whole
block body trips Style/RedundantBegin on the RuboCop 1.31/1.50 resolved
for Ruby 2.6 and 2.7, and the block level ensure that would replace it
is 2.6+ syntax that RuboCop 1.81 rejects under the 2.4 parser. Move the
restore into a minitest after hook, which is valid on every supported
Ruby.
Every CI job resolves its own Gemfile.lock, so an unpinned rubocop meant
Ruby 2.7 linted with 1.31, 2.6 with 1.50 and 3.x with 1.81, and a cop
whose behavior changed between them failed the build on the old rubies
only. Pin the version so the matrix lints against one rubocop.

Rubies older than 3.1 cannot install the pin: reek and rubycritic hold
parser below 3.3 there, while rubocop 1.60 and up require it. The
Gemfile leaves rubocop out on those rubies and the Rakefile drops the
lint task when the require fails, so 2.6, 2.7 and 3.0 still run the
tests and reek.

The gemspec listed rubocop as an unpinned development dependency, which
is what drove the resolution, so drop it and let the Gemfile hold the
pin. It stays a Gemfile-only dev tool, like it already was in practice.

Also drop samples/rubycritic/compare/skunk_report.txt, a stray "test
output" file no test reads.
@JuanVqz
JuanVqz marked this pull request as ready for review September 9, 2026 19:36
@JuanVqz
JuanVqz requested review from arielj and removed request for arielj September 9, 2026 19:37
--out now sets only Skunk::Config.root. When it is absent, Skunk
reads RubyCritic::Config.root at the moment it is needed instead of
copying it on reset, so .rubycritic.yml is honored and a root left
over from an earlier compare run is never reused.

Compare mode wrote build_details.txt to tmp/rubycritic/compare even
with --out. It now goes to <out>/compare/build_details.txt.

--out rejects an empty path, which made RubyCritic write reports into
the current directory, and an existing file, the old -o FILE usage.
Both exit 1 with an error.

skunk_report.txt is written only with --out, so a plain skunk run
still writes no files. SHARE_URL="" now falls back to the default
share URL. bin/console passes its formats through argv because
Application#execute resets the config. CHANGELOG marks --out as a
breaking change and notes the skunk_report.html rename.
The application share test runs with --out=tmp and left
Skunk::Config.root set. With some seeds (24866 in CI) the compare
test ran next, so build_details went to tmp/compare instead of the
stubbed directory and the assertion failed.
@JuanVqz
JuanVqz merged commit b6f554e into main Oct 12, 2026
20 checks passed
@JuanVqz
JuanVqz deleted the feat/cli-out-path-root branch October 12, 2026 22:32
@JuanVqz JuanVqz mentioned this pull request Oct 12, 2026
1 task done
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