Skip to content

Commit

Permalink
Merge branch 'master' into AO3-6712
Browse files Browse the repository at this point in the history
  • Loading branch information
weeklies authored Jan 16, 2025
2 parents faf28e6 + 092aa07 commit 32a4b25
Show file tree
Hide file tree
Showing 450 changed files with 26,616 additions and 16,004 deletions.
2 changes: 0 additions & 2 deletions .erb-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ 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
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Bash scripts needs to have LF line endings, even on Windows
*.sh text eol=lf
# /usr/local/bin/ruby: warning: shebang line ending with \r may cause problems
/bin/* text eol=lf
13 changes: 11 additions & 2 deletions .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- 3306:3306

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.5
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.26
ports:
- 9200:9200
options: >-
Expand All @@ -58,12 +58,15 @@ jobs:
arguments: spec/models
- command: rspec
arguments: --exclude-pattern 'spec/{controllers,models}/**/*.rb'
libvips: true
- command: cucumber
arguments: features/admins
libvips: true
- command: cucumber
arguments: features/bookmarks
- command: cucumber
arguments: features/collections
libvips: true
- command: cucumber
arguments: features/comments_and_kudos
- command: cucumber
Expand All @@ -73,8 +76,10 @@ jobs:
vcr: true
- command: cucumber
arguments: features/other_a
libvips: true
- command: cucumber
arguments: features/other_b
libvips: true
- command: cucumber
arguments: features/prompt_memes_a
- command: cucumber
Expand Down Expand Up @@ -129,6 +134,10 @@ jobs:
restore-keys: |
cassette-library-${{ hashFiles(matrix.tests.arguments) }}-
- name: Install libvips for image processing
if: ${{ matrix.tests.libvips }}
run: sudo apt-get install -y libvips-dev

- name: Set up Ruby and run bundle install
uses: ruby/setup-ruby@v1
with:
Expand All @@ -150,7 +159,7 @@ jobs:
run: bundle exec ${{ matrix.tests.command }} ${{ matrix.tests.arguments }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
# Optional for public repos. However, individual forks can set this
# secret to reduce the chance of being rate-limited by GitHub.
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/phrase-export-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Check Phrase exports
on:
pull_request:
branches:
- master
- main
workflow_dispatch:

jobs:
en-keys-to-remove:
if: github.head_ref == 'phrase-translations'
runs-on: ubuntu-latest
name: Check for outdated English keys in Phrase

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: Run i18n-tasks missing (diff mode)
run: bundle exec i18n-tasks missing -t diff -f keys en | bundle exec i18n-tasks tree-mv -f keys "en.{*}" "\1" > en-keys-to-remove.txt

- name: Check that all keys exported from Phrase exist in English
run: "! test -s en-keys-to-remove.txt"

- name: Upload list of English keys that should be removed from Phrase
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: en-keys-to-remove
path: en-keys-to-remove.txt

unused-keys:
if: github.head_ref == 'phrase-translations'
runs-on: ubuntu-latest
needs: en-keys-to-remove
name: Check unused keys for all locales

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: Run i18n-tasks unused
run: bundle exec i18n-tasks unused -f keys > unused-keys.txt

- name: Upload list of unused locale keys
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: unused-keys
path: unused-keys.txt

inconsistent-interpolations:
if: github.head_ref == 'phrase-translations'
runs-on: ubuntu-latest
name: Check consistent interpolations for all locales

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: Run i18n-tasks check-consistent-interpolations
run: bundle exec i18n-tasks check-consistent-interpolations -f yaml > inconsistent-interpolations.yml
continue-on-error: true

- name: Upload yaml of inconsistent interpolations
uses: actions/upload-artifact@v4
with:
name: inconsistent-interpolations
path: inconsistent-interpolations.yml
8 changes: 5 additions & 3 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ jobs:
bundler-cache: true

- name: rubocop
uses: reviewdog/action-rubocop@708a61f1f3bc4127205f5ec59f4f8617478ebdda
uses: reviewdog/action-rubocop@cd8c2943f425b54f97095777109ae9f1f2d79a61
with:
use_bundler: true
reporter: github-pr-check
skip_install: true
fail_level: any

erb-lint:
name: ERB Lint runner
Expand All @@ -44,7 +45,8 @@ jobs:
bundler-cache: true

- name: erb-lint
uses: tk0miya/action-erblint@667687e73b44e7b7a710a1204b180f49f80ebb5e
uses: tk0miya/action-erblint@b6e537f4616e4fa7a9eef209ca34ca944e1440dd
with:
use_bundler: true
reporter: github-pr-check # default
reporter: github-pr-check
fail_on_error: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public/system/test
# /tmp/
/tmp/*

# ActiveRecord storage path
storage/

# /vendor/
/vendor/gems

Expand Down
17 changes: 17 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
tasks:
- init: ./script/docker/init.sh
command: docker compose up -d web

ports:
- port: 3000
onOpen: open-browser
- port: 3306
onOpen: ignore
- port: 6379
onOpen: ignore
- port: 9200
onOpen: ignore
- port: 9300
onOpen: ignore
- port: 9400
onOpen: ignore
6 changes: 3 additions & 3 deletions .phrase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ phrase:
- file: ./config/locales/phrase-exports/ru.yml
params:
locale_id: ru
- file: ./config/locales/phrase-exports/scr.yml
params:
locale_id: scr
- file: ./config/locales/phrase-exports/sk.yml
params:
locale_id: sk
- file: ./config/locales/phrase-exports/sl.yml
params:
locale_id: sl
- file: ./config/locales/phrase-exports/sr.yml
params:
locale_id: sr
- file: ./config/locales/phrase-exports/sv.yml
params:
locale_id: sv
Expand Down
16 changes: 12 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# 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:
Expand All @@ -14,7 +11,7 @@ inherit_mode:

AllCops:
NewCops: enable
TargetRubyVersion: 3.0
TargetRubyVersion: 3.1

Bundler/OrderedGems:
Enabled: false
Expand Down Expand Up @@ -53,6 +50,12 @@ Lint/AmbiguousBlockAssociation:
Lint/AmbiguousRegexpLiteral:
Enabled: false

Lint/RedundantSafeNavigation:
Exclude:
# Take a better safe than sorry approach to safe navigation in admin
# policies.
- 'app/policies/*.rb'

Metrics/AbcSize:
Enabled: false

Expand Down Expand Up @@ -119,6 +122,11 @@ Migration/LargeTableSchemaUpdate:
- users
- works

Naming/VariableNumber:
AllowedIdentifiers:
- age_over_13
- no_age_over_13

Rails/DefaultScope:
Enabled: true

Expand Down
Loading

0 comments on commit 32a4b25

Please sign in to comment.