Open kpumuk opened 2 months ago
Some discussion about this with @postmodern https://ruby.social/@postmodern/112890522679233029
Just realized that excluding gemspec.yml and keeping gemspec might not have too much sense, since the gemspec depends on the yml file (and not used in runtime), so probably might be excluded as well.
Some examples in the wild (see Rubygems top 10 https://rubygems.org/stats):
Current rubygems guidelines suggest to only include runtime files as a best practice: https://github.com/rubygems/guides/issues/90. Additionally, the test-files contain insecure
Gemfile.lock
files which can sometimes trigger other vulnerability scanners when they scanbundler-audit
.In this MR I propose to remove the following:
.
in the root of the repository (includes GitHub workflows and issue templates, RSpec configuration, Yard settings)Gemfile
as it is only needed for development and not used in runtimegemspec.yml
which is used to construct gemspec and not used after thatspec/
includes test files and fixturesTo consider:
Rakefile
referencesrspec
andyard
which are development-only dependencies.bundler-audit.gemspec
since it is only used in development to produce metadata, added to the gem package as a YAML-serializedGem::Specification
ChangeLog.md
probably is not looked at ever and only takes space.Prior art
Since RuboCop added
test_files
to deprecated gemspec attributes, the directive was removed in https://github.com/rubysec/bundler-audit/pull/370 (see discussion in https://github.com/rubocop/rubocop/issues/10675).File list difference
To test, I built the gem with
rake build
and compared the listing before and after the change:Full diff:
Closes #361