Skip to content

Commit

Permalink
Merge pull request #4387 from sanger/develop
Browse files Browse the repository at this point in the history
Develop into master
  • Loading branch information
yoldas authored Oct 1, 2024
2 parents dceebda + 45ba7a6 commit 26841e3
Show file tree
Hide file tree
Showing 866 changed files with 8,753 additions and 5,278 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
name: Linting
on:
- push
- pull_request
push:
pull_request:
types:
# defaults
- opened
- synchronize
- reopened
# custom
- ready_for_review # required for Github-created PRs

jobs:
rubocop:
Expand All @@ -12,22 +19,22 @@ jobs:
RUBOCOP_CACHE_ROOT: ".rubocop-cache"
BUNDLE_WITHOUT: "cucumber deployment profile development default test"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
# Establish a cache of rubocop cache to improve performance
# ${{ env.RUBOCOP_CACHE_ROOT }}
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Set up yarn
run: yarn
run: yarn install
- name: Cache cops
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
${{ env.RUBOCOP_CACHE_ROOT }}
Expand All @@ -46,13 +53,14 @@ jobs:
# and parallel to try and improve speed
- name: Run rubocop
run: bundle exec rubocop --extra-details --display-style-guide --parallel --format github --format progress

eslint:
name: EsLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/lint_yard_docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
name: Lint documentation
on:
- push
- pull_request
push:
pull_request:
types:
# defaults
- opened
- synchronize
- reopened
# custom
- ready_for_review # required for Github-created PRs

jobs:
yard-junk:
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/ruby_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ env:
########

on:
- push
- pull_request
push:
pull_request:
types:
# defaults
- opened
- synchronize
- reopened
# custom
- ready_for_review # required for Github-created PRs

jobs:
rake_tests:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/update-rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
if: (github.repository_owner == 'sanger') # On the sanger fork only
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
Expand All @@ -50,14 +50,18 @@ jobs:
run: bundle exec rubocop --auto-correct --disable-uncorrectable
# https://github.com/marketplace/actions/create-pull-request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v7
with:
title: Automatic Rubocop update
branch: gh_action/update_rubocop
labels: Technical Debt
draft: always-true # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
delete-branch: true
body: |
Automatic update via https://github.com/sanger/sequencescape/blob/develop/.github/workflows/update_rubocop.yml
This cop will trigger safe-autocorrect for new cops, and will
add inline rubocop:todo for other cops. Please sanity check
any changes before merging in.
Click `Ready for review` to trigger the CI checks.
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.42.1
14.42.2
71 changes: 34 additions & 37 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
- rubocop-rspec_rails
- rubocop-capybara
- rubocop-factory_bot

inherit_mode:
merge:
- Exclude

RSpec/AggregateExamples:
# Aggregate examples can be useful, but the cop gets into nasty battles with
# other Spec cops, and is only really of value in expensive tests.
Enabled: false
# Added exclude because api and feature specs do not have a specific class.
RSpec/DescribeClass:
Exclude:
- "spec/requests/**/*.rb"
- "spec/api/**/*.rb"
- "spec/features/**/*.rb"
- "spec/views/**/*.rb"
AllCops:
NewCops: enable
Exclude:
Expand All @@ -32,6 +28,18 @@ AllCops:
- node_modules/**/*
- tmp/**/*

RSpec/AggregateExamples:
# Aggregate examples can be useful, but the cop gets into nasty battles with
# other Spec cops, and is only really of value in expensive tests.
Enabled: false
# Added exclude because api and feature specs do not have a specific class.
RSpec/DescribeClass:
Exclude:
- "spec/requests/**/*.rb"
- "spec/api/**/*.rb"
- "spec/features/**/*.rb"
- "spec/views/**/*.rb"

Rails/SkipsModelValidations:
Exclude:
- "db/migrate/*.rb"
Expand All @@ -48,6 +56,11 @@ Rails:
Lint/AmbiguousRegexpLiteral:
Exclude:
- features/support/step_definitions/**/*

# Only use shorthand hash syntax when all keys match the variables for better readability
Style/HashSyntax:
EnforcedShorthandSyntax: consistent

# Enforces 1234565789 as 123_456_789: While nice when dealing with actual big
# numbers, we're more likely to see it shout at us about barcodes.
Style/NumericLiterals:
Expand Down Expand Up @@ -154,7 +167,7 @@ Metrics/ClassLength:
Exclude:
- "spec/**/*"
- "test/**/*"
RSpec/Rails/AvoidSetupHook:
RSpecRails/AvoidSetupHook:
Exclude:
- "test/**/*"

Expand All @@ -173,14 +186,19 @@ Rails/RedundantPresenceValidationOnBelongsTo:
Rails/UniqueValidationWithoutIndex:
Enabled: false

# Disabling newly introduced cops until we have time to sort out the offenses
FactoryBot/ConsistentParenthesesStyle:
# Factory Bot
FactoryBot/FactoryAssociationWithStrategy:
Enabled: false

# Capybara
Capybara/ClickLinkOrButtonStyle:
Enabled: false

# Disabling newly introduced cops until we have time to sort out the offenses
Rails/I18nLocaleTexts: # new in 2.14
Enabled: false

RSpec/Rails/InferredSpecType: # new in 2.14
RSpecRails/InferredSpecType: # new in 2.14
Enabled: false

Lint/NonAtomicFileOperation: # new in 1.31
Expand All @@ -202,12 +220,6 @@ RSpec/SpecFilePathFormat:
RSpec/PendingWithoutReason:
Enabled: false

Capybara/ClickLinkOrButtonStyle:
Enabled: false

FactoryBot/FactoryAssociationWithStrategy:
Enabled: false

Performance/MapMethodChain:
Enabled: false

Expand All @@ -216,20 +228,5 @@ Rails/ThreeStateBooleanColumn:

RSpec/ExpectInHook:
Enabled: false

# New in Ruby 3.2 upgrade

Naming/BlockForwarding:
Enabled: false

Style/ArgumentsForwarding:
Enabled: false

Style/ArrayIntersect:
Enabled: false

Style/EmptyMethod:
Enabled: false

Style/HashSyntax:
Enabled: false
# Added to Rubocop Todo and handling from there
Loading

0 comments on commit 26841e3

Please sign in to comment.