-
Notifications
You must be signed in to change notification settings - Fork 15
Fix rubocop action: use rubocop 1.50.0 and ruby 3.2.2 (but TargetRubyVersion set to 2.5) and do not use deprecated GHA set-output #222
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
Conversation
…e to run tests backward) Avoid the "message": "Lint/Syntax: Lint/Syntax: unexpected token tRBRACK\n(Using Ruby 2.3 parser; configure using `TargetRubyVersion` parameter, under `AllCops`) (Correctable)",
| # Where a Cop is not listed, it uses the Rubocop defaults. | ||
|
|
||
| AllCops: | ||
| TargetRubyVersion: 2.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configure TargetRubyVersion to 2.5 so we can still run backward in time down to OpenStudio 3.0.0 at least
| - uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '2.7' | ||
| ruby-version: '3.2.2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 3.2.2 in the action
| autocorrect: true | ||
| commit-auto-correct: true | ||
| rubocop-version: 0.81.0 | ||
| rubocop-version: 1.50.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
USe rubocop 1.50.0. So it's the same as the Current OpenStudio CLI
| Metrics/CollectionLiteralLength: | ||
| Enabled: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New config
| Metrics/MethodLength: | ||
| Max: 350 | ||
| Max: 600 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tweak
| # Don't force an if to a case | ||
| Style/CaseLikeIf: | ||
| Enabled: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New config
…rics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/ParameterLists
```
test_helpers.rb:512:55: E: Style/OptionalBooleanParameter: Prefer keyword arguments for arguments with a boolean default value; use compare_eui: true instead of compare_eui = true.
def postprocess_out_osw_and_copy(out_osw, cp_out_osw, compare_eui = true)
^^^^^^^^^^^^^^^^^^
```
|
Ok, checked manually that the results are the same for changed tests before and after this PR. merging. |
This was long overdue, we have been getting failures on all PRs for several months
Note: I updated rubocop-composite-actions
Update to use Ruby 3.2.2 and Rubocop 1.50.0 (matches current OS SDK version), but TargetRubyVersion 2.5 (so we can run backwards down to OS SDK 3.0.0)
Fix all offenses with this newer rubocop
Link to the Ubuntu 22.04 .deb installer to use for CI Testing. If not set, it will default to latest official release.
[OpenStudio Installer]: http://openstudio-ci-builds.s3-website-us-west-2.amazonaws.com/PR-5426/OpenStudio-3.10.0-rc1%2B1191f7e597-Ubuntu-22.04-x86_64.deb