Repository navigation
Allow Skunk to generate reports in a given path with the --out flag - #131
Merged
Merged
Conversation
JuanVqz
force-pushed
the
feat/cli-out-path-root
branch
from
November 17, 2025 22:13
65f04b5 to
1411dcc
Compare
JuanVqz
force-pushed
the
feat/cli-out-path-root
branch
from
February 6, 2026 05:27
1411dcc to
23da5f1
Compare
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.
Skunk_report (txt,json,html)
- 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
force-pushed
the
feat/cli-out-path-root
branch
from
September 8, 2026 17:19
23da5f1 to
b66b365
Compare
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
marked this pull request as ready for review
September 9, 2026 19:36
# Conflicts: # CHANGELOG.md
--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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
CHANGELOG.mdthat links to this PR under the "main (unreleased)" heading.Description:
This is a breaking change:
-o/--outused 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,htmlwritesreports/skunk_report.txt,reports/skunk_report.jsonandreports/skunk_report.html. The HTML report is renamed fromskunk_overview.htmltoskunk_report.htmlso the three formats share one name.--out, nothing moves: JSON and HTML go to RubyCritic's root (tmp/rubycritic, or thepathset in.rubycritic.yml), and the console report is only printed, as before.--outsetsSkunk::Config.root, which falls back toRubyCritic::Config.rootwhen--outis not given. RubyCritic's own root is left alone, so Skunk's reports can live somewhere else than RubyCritic's.skunk -b main --out reports) writesbuild_details.txttoreports/compare/. RubyCritic's ownbuild_number.txtstays under RubyCritic's root.--outrejects a path that is an existing file, so an old-o skunk_report.txtcall against an existing report fails with a clear error. It also rejects an empty path. Both exit 1.~> 1.81.0on 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.