Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into AO3-5860
Browse files Browse the repository at this point in the history
  • Loading branch information
ceithir committed Apr 11, 2024
2 parents 9266392 + bd57a26 commit b329103
Show file tree
Hide file tree
Showing 557 changed files with 18,921 additions and 4,914 deletions.
6 changes: 6 additions & 0 deletions .erb-lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
EnableDefaultLinters: true
linters:
AllowedScriptType:
allowed_types:
- "text/javascript"
- "speculationrules"
DeprecatedClasses:
enabled: true
rule_set:
Expand All @@ -11,6 +15,8 @@ linters:
rubocop_config:
inherit_from:
- .rubocop.yml
# Uncomment the following line to ignore known issues
# - .rubocop_todo_erb.yml
Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation
Layout/InitialIndentation:
Expand Down
5 changes: 2 additions & 3 deletions .github/labeler/awaiting.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"Awaiting Review":
- "**/*"
- ".*"
- ".*/**/*"
- changed-files:
- any-glob-to-any-file: "**/*"
15 changes: 8 additions & 7 deletions .github/labeler/contents.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"Gem Updates":
- "Gemfile"
- "Gemfile.lock"
- changed-files:
- any-glob-to-any-file: ["Gemfile", "Gemfile.lock"]

"Has Migrations":
- "db/migrate/**/*"
- changed-files:
- any-glob-to-any-file: "db/migrate/**/*"

"Scope: i18n Only":
- all:
- "config/locales/**/*"
- changed-files:
- any-glob-to-all-files: "config/locales/**/*"

"Scope: Tests Only":
- all:
- "{factories,features,spec,test,.github}/**/*"
- changed-files:
- any-glob-to-all-files: "{factories,features,spec,test,.github}/**/*"
11 changes: 6 additions & 5 deletions .github/labeler/review.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Label to be added when the PR is updated:
"Coder Has Actioned Review":
- "**/*"
- ".*"
- ".*/**/*"
- changed-files:
- any-glob-to-any-file: "**/*"

# Label to be removed when the PR is updated:
"Reviewed: Action Needed": []
# Condition is always false so the label is removed when the PR is updated:
"Reviewed: Action Needed":
- changed-files:
- any-glob-to-any-file: "!**/*"
17 changes: 5 additions & 12 deletions .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run apt-get update
run: sudo apt-get update
Expand All @@ -104,24 +104,17 @@ jobs:
sudo apt-get install -y redis-server
./script/gh-actions/multiple_redis.sh
- name: Cache wkhtmltopdf package
if: ${{ matrix.tests.ebook }}
uses: actions/cache@v3
with:
path: wkhtmltopdf
key: wkhtmltopdf-${{ hashFiles('script/gh-actions/ebook_converters.sh') }}

- name: Install ebook converters
if: ${{ matrix.tests.ebook }}
run: ./script/gh-actions/ebook_converters.sh

- name: Cache VCR cassettes
if: ${{ matrix.tests.vcr }}
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: features/cassette_library

# Unfortunately, the actions/cache@v3 version doesn't allow the cache
# Unfortunately, the actions/cache@v4 version doesn't allow the cache
# key to be overwritten if there's an exact match. So instead we add
# a unique identifier to the key to always force a "cache miss", and
# restore from related keys to make sure that we still get to load a
Expand Down Expand Up @@ -156,7 +149,7 @@ jobs:
run: bundle exec ${{ matrix.tests.command }} ${{ matrix.tests.arguments }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
# Optional for public repos. However, individual forks can set this
# secret to reduce the chance of being rate-limited by GitHub.
Expand All @@ -167,7 +160,7 @@ jobs:

- name: Upload failure screenshots
if: ${{ failure() && matrix.tests.command == 'cucumber' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test failures ${{ hashFiles('tmp/capybara/*') }}
path: tmp/capybara
4 changes: 2 additions & 2 deletions .github/workflows/brakeman-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Ruby and run bundle install
uses: ruby/setup-ruby@v1
Expand All @@ -39,6 +39,6 @@ jobs:
# Upload the SARIF file generated in the previous step
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: output.sarif.json
6 changes: 3 additions & 3 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ jobs:
steps:

- name: Content-Based
uses: actions/labeler@v4
uses: actions/labeler@v5
with:
configuration-path: ".github/labeler/contents.yml"
repo-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Awaiting Review
uses: actions/labeler@v4
uses: actions/labeler@v5
if: github.event.action == 'opened'
with:
configuration-path: ".github/labeler/awaiting.yml"
repo-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Coder Has Actioned Review
uses: actions/labeler@v4
uses: actions/labeler@v5
# https://github.uint.cloudmunity/t/do-something-if-a-particular-label-is-set/17149/4
if: "contains(github.event.pull_request.labels.*.name, 'Reviewed: Action Needed')"
with:
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Based on https://github.com/tk0miya/action-erblint/blob/main/README.md#example-usage

name: Reviewdog

on: [pull_request]

permissions:
checks: write

jobs:
rubocop:
name: Rubocop
runs-on: ubuntu-latest
env:
BUNDLE_ONLY: linters
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Ruby and run bundle install
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: rubocop
uses: reviewdog/action-rubocop@2c8048e3169487eccc1eed812daaa6e5275a809f
with:
use_bundler: true
reporter: github-pr-check
skip_install: true

erb-lint:
name: ERB Lint runner
runs-on: ubuntu-latest
env:
BUNDLE_ONLY: linters
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Ruby and run bundle install
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: erb-lint
uses: tk0miya/action-erblint@667687e73b44e7b7a710a1204b180f49f80ebb5e
with:
use_bundler: true
reporter: github-pr-check # default
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.idea
stdout
*~
.vscode/
# /
/*.tmproj
/sphinx
Expand Down
7 changes: 1 addition & 6 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# Available linter versions:
# http://help.houndci.com/en/articles/2461415-supported-linters

erblint:
enabled: true
config_file: .erb-lint.yml

jshint:
config_file: .jshintrc
ignore_file: .jshintignore

rubocop:
version: 0.83.0
config_file: .rubocop.yml
enabled: false
86 changes: 80 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
# Uncomment the following line to ignore known issues
# inherit_from: .rubocop_todo.yml

# Options available at https://github.com/bbatsov/rubocop/blob/master/config/default.yml

require:
- rubocop-rails
- rubocop-rspec
- ./rubocop/rubocop

inherit_mode:
merge:
- Exclude

AllCops:
RSpec:
Patterns:
- "(?:^|/)factories/"
- "(?:^|/)features/"
- "(?:^|/)spec/"
TargetRubyVersion: 2.7
NewCops: enable
TargetRubyVersion: 3.0

Bundler/OrderedGems:
Enabled: false

I18n/DeprecatedTranslationKey:
Rules:
name_with_colon: "Prefer `name` with `mailer.general.metadata_label_indicator` over `name_with_colon`"

Layout/DotPosition:
EnforcedStyle: leading

Layout/EmptyLinesAroundAttributeAccessor:
Enabled: false

Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent

Expand All @@ -27,6 +38,9 @@ Layout/LineLength:
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented

Layout/SingleLineBlockChain:
Enabled: true

Layout/TrailingWhitespace:
Enabled: false

Expand Down Expand Up @@ -63,6 +77,51 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Enabled: false

Migration/LargeTableSchemaUpdate:
Tables:
- abuse_reports
- admin_activities
- audits
- bookmarks
- comments
- common_taggings
- collection_items
- collection_participants
- collection_profiles
- collections
- creatorships
- external_works
- favorite_tags
- feedbacks
- filter_counts
- filter_taggings
- gifts
- inbox_comments
- invitations
- kudos
- log_items
- mutes
- preferences
- profiles
- prompts
- pseuds
- readings
- set_taggings
- serial_works
- series
- skins
- stat_counters
- subscriptions
- tag_nominations
- tag_set_associations
- tags
- taggings
- users
- works

Rails/DefaultScope:
Enabled: true

Rails/DynamicFindBy:
AllowedMethods:
# Exception for Tag.find_by_name
Expand All @@ -78,6 +137,9 @@ Rails/DynamicFindBy:
# Exceptions for InboxComment.find_by_filters
- find_by_filters

Rails/EnvironmentVariableAccess:
Enabled: true

# Allow all uses of html_safe, they're everywhere...
Rails/OutputSafety:
Enabled: false
Expand All @@ -90,6 +152,9 @@ Rails/Output:
Rails/RakeEnvironment:
Enabled: false

Rails/ReversibleMigrationMethodDefinition:
Enabled: true

# Allow update_attribute, update_all, touch, etc.
Rails/SkipsModelValidations:
Enabled: false
Expand All @@ -101,6 +166,12 @@ Rails/UnknownEnv:
- staging
- production

RSpec:
Include:
- "(?:^|/)factories/"
- "(?:^|/)features/"
- "(?:^|/)spec/"

# Allow "allow_any_instance_of"
RSpec/AnyInstance:
Enabled: false
Expand Down Expand Up @@ -202,6 +273,9 @@ Style/PercentLiteralDelimiters:
Style/RedundantSelf:
Enabled: false

Style/SelectByRegexp:
Enabled: true

Style/SingleLineMethods:
AllowIfMethodIsEmpty: false

Expand Down
Loading

0 comments on commit b329103

Please sign in to comment.