Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): make rubocop happy #181

Merged
merged 2 commits into from
Jul 17, 2020

Conversation

baby-gnu
Copy link
Contributor

@baby-gnu baby-gnu commented Jul 17, 2020

PR progress checklist (to be filled in by reviewers)

  • Changes to documentation are appropriate (or tick if not required)
  • Changes to tests are appropriate (or tick if not required)
  • Reviews completed

What type of PR is this?

Primary type

  • [build] Changes related to the build system
  • [chore] Changes to the build process or auxiliary tools and libraries such as documentation generation
  • [ci] Changes to the continuous integration configuration
  • [feat] A new feature
  • [fix] A bug fix
  • [perf] A code change that improves performance
  • [refactor] A code change that neither fixes a bug nor adds a feature
  • [revert] A change used to revert a previous commit
  • [style] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)

Secondary type

  • [docs] Documentation changes
  • [test] Adding missing or correcting existing tests

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

#167

Describe the changes you're proposing

This PR:

  • remove the Serverspec files because everything is covered by Inspec
  • make rubocop happy with the tests code

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

$ rubocop -d
For /home/travis/build/baby-gnu/openssh-formula: configuration from /home/travis/build/baby-gnu/openssh-formula/.rubocop.yml
Default configuration from /home/travis/.rvm/gems/ruby-2.6.5/gems/rubocop-0.88.0/config/default.yml
The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file:
 - Layout/EmptyLinesAroundAttributeAccessor (0.83)
 - Layout/SpaceAroundMethodCallOperator (0.82)
 - Lint/DeprecatedOpenSSLConstant (0.84)
 - Lint/DuplicateElsifCondition (0.88)
 - Lint/MixedRegexpCaptureTypes (0.85)
 - Lint/RaiseException (0.81)
 - Lint/StructNewOverride (0.81)
 - Style/AccessorGrouping (0.87)
 - Style/ArrayCoercion (0.88)
 - Style/BisectedAttrAccessor (0.87)
 - Style/CaseLikeIf (0.88)
 - Style/ExponentialNotation (0.82)
 - Style/HashAsLastArrayItem (0.88)
 - Style/HashEachMethods (0.80)
 - Style/HashLikeCase (0.88)
 - Style/HashTransformKeys (0.80)
 - Style/HashTransformValues (0.80)
 - Style/RedundantAssignment (0.87)
 - Style/RedundantFetchBlock (0.86)
 - Style/RedundantFileExtensionInRequire (0.88)
 - Style/RedundantRegexpCharacterClass (0.85)
 - Style/RedundantRegexpEscape (0.85)
 - Style/SlicingWithRange (0.83)
For more information: https://docs.rubocop.org/rubocop/versioning.html
Inspecting 5 files
Scanning /home/travis/build/baby-gnu/openssh-formula/Gemfile
.Scanning /home/travis/build/baby-gnu/openssh-formula/bin/kitchen
.Scanning /home/travis/build/baby-gnu/openssh-formula/test/integration/default/controls/config_spec.rb
.Scanning /home/travis/build/baby-gnu/openssh-formula/test/integration/default/controls/packages_spec.rb
.Scanning /home/travis/build/baby-gnu/openssh-formula/test/integration/default/controls/services_spec.rb
.

5 files inspected, no offenses detected
Finished in 0.2538999359999963 seconds
The command "rubocop -d" exited with 0.

Documentation checklist

  • Updated the README (e.g. Available states).
  • Updated pillar.example.

Testing checklist

  • Included in Kitchen (i.e. under state_top).
  • Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
  • Updated the relevant test pillar.

Additional context

All tests provided by Serverspec are covered by Inspec.
* test/integration/default/controls/services_spec.rb: favor modifier
  if usage when having a single-line body.

* test/integration/default/controls/config_spec.rb: add frozen string
  literal comment.

* test/integration/default/controls/packages_spec.rb: ditoo.

* test/integration/default/controls/services_spec.rb: ditoo.
@pull-assistant
Copy link

Score: NaN

Best reviewed: with all changes


Optimal code review plan (2 commits squashed)

feat(test): remove s... ... fix(inspec): make ru...

Squashed 2 commits:

Powered by Pull Assistant. Last update 049db2b ... 2cfb5a7. Read the comment docs.

@baby-gnu baby-gnu changed the title Fix/make rubocop happy fix(test): make rubocop happy Jul 17, 2020
@baby-gnu baby-gnu requested a review from myii July 17, 2020 14:55
@myii
Copy link
Member

myii commented Jul 17, 2020

@baby-gnu Thanks for the PR. Couple of bits of feedback for you:


feat(test): remove serverspec files

There were a few discussions about this when InSpec tests were added here:

I didn't want to be presumptuous at the time and simply remove the Serverspec tests. I think we're OK now so should be able to remove but not 100% sure about where we stand with #167.


fix(inspec): make rubocop happy

Since Rubocop is now working, we can merge it into the main lint job:

# Run the `rubocop` linter in a separate job that is allowed to fail
# Once these lint errors are fixed, this can be merged into a single job

So that's simply using the structure from the template-formula here.

@baby-gnu
Copy link
Contributor Author

feat(test): remove serverspec files

I wasn't sure about this but found some discussion about doing like in vault.

So I thought that getting rid of the files would have been a first step.

fix(inspec): make rubocop happy

Yes, I plan to do that separately with the update of the matrix and all.

@myii myii merged commit 2d1804d into saltstack-formulas:master Jul 17, 2020
@myii
Copy link
Member

myii commented Jul 17, 2020

@baby-gnu OK, let's get this merged!

@myii
Copy link
Member

myii commented Jul 17, 2020

Closed #167, since no longer seems valid.

@saltstack-formulas-travis

🎉 This PR is included in version 1.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@baby-gnu baby-gnu deleted the fix/make-rubocop-happy branch July 17, 2020 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants