From 4595862978a7f726fbd6139a1bc415cc83cf34fe Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 6 Mar 2023 09:43:21 -0500 Subject: Remove pinned rexml (#23964) --- Gemfile.lock | 1 - 1 file changed, 1 deletion(-) (limited to 'Gemfile.lock') diff --git a/Gemfile.lock b/Gemfile.lock index 6f75f8f76..c6b4e74f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -855,7 +855,6 @@ DEPENDENCIES redcarpet (~> 3.6) redis (~> 4.5) redis-namespace (~> 1.10) - rexml (~> 3.2) rqrcode (~> 2.1) rspec-rails (~> 6.0) rspec-sidekiq (~> 3.1) -- cgit From e594bb7d5042f4a531334fd29bf4961f2152c4fa Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 6 Mar 2023 22:49:43 -0500 Subject: Convert CircleCI to GitHub Actions (#23608) --- .circleci/config.yml | 128 ------------------------------------ .github/workflows/test-ruby.yml | 139 ++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 2 - Gemfile | 1 + Gemfile.lock | 2 + README.md | 3 +- config/webpacker.yml | 2 +- 7 files changed, 144 insertions(+), 133 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/test-ruby.yml (limited to 'Gemfile.lock') diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 3913a6b0f..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,128 +0,0 @@ -version: 2.1 - -orbs: - ruby: circleci/ruby@2.0.0 - node: circleci/node@5.0.3 - -executors: - default: - parameters: - ruby-version: - type: string - docker: - - image: cimg/ruby:<< parameters.ruby-version >> - environment: - BUNDLE_JOBS: 3 - BUNDLE_RETRY: 3 - CONTINUOUS_INTEGRATION: true - DB_HOST: localhost - DB_USER: root - DISABLE_SIMPLECOV: true - RAILS_ENV: test - - image: cimg/postgres:14.5 - environment: - POSTGRES_USER: root - POSTGRES_HOST_AUTH_METHOD: trust - - image: cimg/redis:7.0 - -commands: - install-system-dependencies: - steps: - - run: - name: Install system dependencies - command: | - sudo apt-get update - sudo apt-get install -y libicu-dev libidn11-dev - install-ruby-dependencies: - parameters: - ruby-version: - type: string - steps: - - run: - command: | - bundle config clean 'true' - bundle config frozen 'true' - bundle config without 'development production' - name: Set bundler settings - - ruby/install-deps: - bundler-version: '2.3.26' - key: ruby<< parameters.ruby-version >>-gems-v2 - wait-db: - steps: - - run: - command: dockerize -wait tcp://localhost:5432 -wait tcp://localhost:6379 -timeout 1m - name: Wait for PostgreSQL and Redis - -jobs: - build: - docker: - - image: cimg/ruby:3.2-node - environment: - RAILS_ENV: test - steps: - - checkout - - install-system-dependencies - - install-ruby-dependencies: - ruby-version: '3.2' - - node/install-packages: - cache-version: v1 - pkg-manager: yarn - - run: - command: | - export NODE_OPTIONS=--openssl-legacy-provider - ./bin/rails assets:precompile - name: Precompile assets - - persist_to_workspace: - paths: - - public/assets - - public/packs-test - root: . - - test: - parameters: - ruby-version: - type: string - executor: - name: default - ruby-version: << parameters.ruby-version >> - environment: - ALLOW_NOPAM: true - PAM_ENABLED: true - PAM_DEFAULT_SERVICE: pam_test - PAM_CONTROLLED_SERVICE: pam_test_controlled - parallelism: 4 - steps: - - checkout - - install-system-dependencies - - run: - command: sudo apt-get install -y ffmpeg imagemagick libmagickcore-dev libmagickwand-dev libjpeg-dev libpng-dev libtiff-dev libwebp-dev libpam-dev - name: Install additional system dependencies - - run: - command: bundle config with 'pam_authentication' - name: Enable PAM authentication - - install-ruby-dependencies: - ruby-version: << parameters.ruby-version >> - - attach_workspace: - at: . - - wait-db - - run: - command: ./bin/rails db:create db:schema:load db:seed - name: Load database schema - - ruby/rspec-test - -workflows: - version: 2 - build-and-test: - jobs: - - build - - test: - matrix: - parameters: - ruby-version: - - '2.7' - - '3.0' - - '3.1' - - '3.2' - name: test-ruby<< matrix.ruby-version >> - requires: - - build diff --git a/.github/workflows/test-ruby.yml b/.github/workflows/test-ruby.yml new file mode 100644 index 000000000..60f5df885 --- /dev/null +++ b/.github/workflows/test-ruby.yml @@ -0,0 +1,139 @@ +name: Ruby Testing + +on: + push: + pull_request: + +env: + BUNDLE_CLEAN: true + BUNDLE_FROZEN: true + BUNDLE_WITHOUT: 'development production' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + env: + RAILS_ENV: test + + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + cache: yarn + node-version-file: '.nvmrc' + + - name: Install native Ruby dependencies + run: sudo apt-get install -y libicu-dev libidn11-dev + + - name: Set up bundler cache + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - run: yarn install --frozen-lockfile + - name: Precompile assets + # Previously had set this, but it's not supported + # export NODE_OPTIONS=--openssl-legacy-provider + run: |- + ./bin/rails assets:precompile + + - uses: actions/upload-artifact@v3 + with: + path: |- + ./public/assets + ./public/packs-test + name: ${{ github.sha }} + retention-days: 0 + + test: + runs-on: ubuntu-latest + + needs: + - build + + services: + postgres: + image: postgres:14.5 + env: + POSTGRES_PASSWORD: postgres + POSTGRES_USER: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + + redis: + image: redis:7.0 + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 6379:6379 + + env: + DB_HOST: localhost + DB_USER: postgres + DB_PASS: postgres + DISABLE_SIMPLECOV: true + RAILS_ENV: test + ALLOW_NOPAM: true + PAM_ENABLED: true + PAM_DEFAULT_SERVICE: pam_test + PAM_CONTROLLED_SERVICE: pam_test_controlled + BUNDLE_WITH: 'pam_authentication' + CI_JOBS: ${{ matrix.ci_job }}/4 + + strategy: + fail-fast: false + matrix: + ruby-version: + - '2.7' + - '3.0' + - '3.1' + - '.ruby-version' + ci_job: + - 1 + - 2 + - 3 + - 4 + steps: + - uses: actions/checkout@v3 + + - uses: actions/download-artifact@v3 + with: + path: './public' + name: ${{ github.sha }} + + - name: Install native Ruby dependencies + run: sudo apt-get install -y libicu-dev libidn11-dev + + - name: Install additional system dependencies + run: sudo apt-get install -y ffmpeg imagemagick libpam-dev + + - name: Set up bundler cache + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version}} + bundler-cache: true + + - name: Update system gems + if: matrix.ruby-version == '2.7' + run: gem update --system + + - name: Load database schema + run: './bin/rails db:create db:schema:load db:seed' + + - run: bundle exec rake rspec_chunked diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d67b21ee5..c1a5fef79 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,8 +41,6 @@ It is not always possible to phrase every change in such a manner, but it is des - Code style rules (rubocop, eslint) - Normalization of locale files (i18n-tasks) -**Note**: You may need to log in and authorise the GitHub account your fork of this repository belongs to with CircleCI to enable some of the automated checks to run. - ## Documentation The [Mastodon documentation](https://docs.joinmastodon.org) is a statically generated site. You can [submit merge requests to mastodon/documentation](https://github.com/mastodon/documentation). diff --git a/Gemfile b/Gemfile index 5804327cc..dbe9ce8c0 100644 --- a/Gemfile +++ b/Gemfile @@ -104,6 +104,7 @@ group :development, :test do gem 'fuubar', '~> 2.5' gem 'i18n-tasks', '~> 1.0', require: false gem 'rspec-rails', '~> 6.0' + gem 'rspec_chunked', '~> 0.6' gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false gem 'rubocop-rspec', require: false diff --git a/Gemfile.lock b/Gemfile.lock index c6b4e74f6..5afa9775b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -596,6 +596,7 @@ GEM rspec-core (~> 3.0, >= 3.0.0) sidekiq (>= 2.4.0) rspec-support (3.12.0) + rspec_chunked (0.6) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) rubocop (1.45.1) @@ -858,6 +859,7 @@ DEPENDENCIES rqrcode (~> 2.1) rspec-rails (~> 6.0) rspec-sidekiq (~> 3.1) + rspec_chunked (~> 0.6) rspec_junit_formatter (~> 0.6) rubocop rubocop-performance diff --git a/README.md b/README.md index 306665e9a..f517668a9 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,12 @@ [![GitHub release](https://img.shields.io/github/release/mastodon/mastodon.svg)][releases] -[![Build Status](https://img.shields.io/circleci/project/github/mastodon/mastodon.svg)][circleci] +[![Ruby Testing](https://github.com/mastodon/mastodon/actions/workflows/test-ruby.yml/badge.svg)](https://github.com/mastodon/mastodon/actions/workflows/test-ruby.yml) [![Code Climate](https://img.shields.io/codeclimate/maintainability/mastodon/mastodon.svg)][code_climate] [![Crowdin](https://d322cqt584bo4o.cloudfront.net/mastodon/localized.svg)][crowdin] [![Docker Pulls](https://img.shields.io/docker/pulls/tootsuite/mastodon.svg)][docker] [releases]: https://github.com/mastodon/mastodon/releases -[circleci]: https://circleci.com/gh/mastodon/mastodon [code_climate]: https://codeclimate.com/github/mastodon/mastodon [crowdin]: https://crowdin.com/project/mastodon [docker]: https://hub.docker.com/r/tootsuite/mastodon/ diff --git a/config/webpacker.yml b/config/webpacker.yml index 0baff662b..1745a1798 100644 --- a/config/webpacker.yml +++ b/config/webpacker.yml @@ -75,7 +75,7 @@ development: test: <<: *default - # CircleCI precompiles packs prior to running the tests. + # CI precompiles packs prior to running the tests. # Also avoids race conditions in parallel_tests. compile: false -- cgit From 6ee39e85f3975e137fb9197a954c321767a4497a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 11:29:57 +0100 Subject: Bump pg from 1.4.5 to 1.4.6 (#24001) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Gemfile.lock') diff --git a/Gemfile.lock b/Gemfile.lock index 5afa9775b..6ab9b00ac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -482,7 +482,7 @@ GEM parslet (2.0.0) pastel (0.8.0) tty-color (~> 0.5) - pg (1.4.5) + pg (1.4.6) pghero (3.1.0) activerecord (>= 6) pkg-config (1.5.1) -- cgit From 49a4a7fa83c4097c787c3599d5954aa13c612b8f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 11:31:46 +0100 Subject: Bump sidekiq-scheduler from 5.0.1 to 5.0.2 (#24004) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Gemfile.lock') diff --git a/Gemfile.lock b/Gemfile.lock index 6ab9b00ac..4b0569e1b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -645,9 +645,9 @@ GEM redis (>= 4.5.0, < 5) sidekiq-bulk (0.2.0) sidekiq - sidekiq-scheduler (5.0.1) + sidekiq-scheduler (5.0.2) rufus-scheduler (~> 3.2) - sidekiq (>= 4, < 8) + sidekiq (>= 6, < 8) tilt (>= 1.4.0) sidekiq-unique-jobs (7.1.29) brpoplpush-redis_script (> 0.1.1, <= 2.0.0) @@ -693,7 +693,7 @@ GEM terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) thor (1.2.1) - tilt (2.0.11) + tilt (2.1.0) timeout (0.3.1) tpm-key_attestation (0.12.0) bindata (~> 2.4) -- cgit From aabf2bf8d6119dd1aac78ea9ced7eb18c2a2033c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 11:32:09 +0100 Subject: Bump rack from 2.2.6.2 to 2.2.6.3 (#23997) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Gemfile.lock') diff --git a/Gemfile.lock b/Gemfile.lock index 4b0569e1b..8fce14aa0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -503,7 +503,7 @@ GEM activesupport (>= 3.0.0) raabro (1.4.0) racc (1.6.2) - rack (2.2.6.2) + rack (2.2.6.3) rack-attack (6.6.1) rack (>= 1.0, < 3) rack-cors (1.1.1) -- cgit From c9860d36d4e8323125186f3479407b476ea6575d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 11:44:23 +0100 Subject: Bump omniauth_openid_connect from 0.6.0 to 0.6.1 (#23991) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Gemfile.lock') diff --git a/Gemfile b/Gemfile index dbe9ce8c0..eaaf1bf1f 100644 --- a/Gemfile +++ b/Gemfile @@ -39,7 +39,7 @@ end gem 'net-ldap', '~> 0.17' gem 'omniauth-cas', '~> 2.0' gem 'omniauth-saml', '~> 1.10' -gem 'omniauth_openid_connect', '~> 0.6.0' +gem 'omniauth_openid_connect', '~> 0.6.1' gem 'omniauth', '~> 1.9' gem 'omniauth-rails_csrf_protection', '~> 0.1' diff --git a/Gemfile.lock b/Gemfile.lock index 8fce14aa0..bf7c3c76f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -397,7 +397,7 @@ GEM loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.8.0.1) + mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -415,7 +415,7 @@ GEM mime-types-data (3.2022.0105) mini_mime (1.1.2) mini_portile2 (2.8.1) - minitest (5.17.0) + minitest (5.18.0) msgpack (1.6.0) multi_json (1.15.0) multipart-post (2.3.0) @@ -457,7 +457,7 @@ GEM omniauth-saml (1.10.3) omniauth (~> 1.3, >= 1.3.2) ruby-saml (~> 1.9) - omniauth_openid_connect (0.6.0) + omniauth_openid_connect (0.6.1) omniauth (>= 1.9, < 3) openid_connect (~> 1.1) openid_connect (1.4.2) @@ -694,7 +694,7 @@ GEM climate_control (>= 0.0.3, < 1.0) thor (1.2.1) tilt (2.1.0) - timeout (0.3.1) + timeout (0.3.2) tpm-key_attestation (0.12.0) bindata (~> 2.4) openssl (> 2.0) @@ -832,7 +832,7 @@ DEPENDENCIES omniauth-cas (~> 2.0) omniauth-rails_csrf_protection (~> 0.1) omniauth-saml (~> 1.10) - omniauth_openid_connect (~> 0.6.0) + omniauth_openid_connect (~> 0.6.1) ox (~> 2.14) parslet pg (~> 1.4) -- cgit From 5da3fd170e5194bdaac063a787e9b6188bfd821b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 11:45:09 +0100 Subject: Bump doorkeeper from 5.6.4 to 5.6.5 (#24009) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Gemfile.lock') diff --git a/Gemfile.lock b/Gemfile.lock index bf7c3c76f..ca6befa2a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -225,7 +225,7 @@ GEM docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - doorkeeper (5.6.4) + doorkeeper (5.6.5) railties (>= 5) dotenv (2.8.1) dotenv-rails (2.8.1) -- cgit From 60d664eab8883ca8cad3edb1924c94efdc33c899 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 12:53:48 +0100 Subject: Bump rubocop from 1.45.1 to 1.48.0 (#23999) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Gemfile.lock') diff --git a/Gemfile.lock b/Gemfile.lock index ca6befa2a..bd1aece57 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -599,18 +599,18 @@ GEM rspec_chunked (0.6) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.45.1) + rubocop (1.48.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.26.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) + rubocop-ast (1.27.0) + parser (>= 3.2.1.0) rubocop-capybara (2.17.0) rubocop (~> 1.41) rubocop-performance (1.16.0) -- cgit From 2f7a663b0bccd7b5de1fa47b89a7bdc7591e69ec Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 9 Mar 2023 08:27:48 -0500 Subject: Explicitly set github repo in instance presenter spec (#24036) --- Gemfile | 1 + Gemfile.lock | 1 + spec/presenters/instance_presenter_spec.rb | 24 ++++++++++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'Gemfile.lock') diff --git a/Gemfile b/Gemfile index eaaf1bf1f..7a836b6ba 100644 --- a/Gemfile +++ b/Gemfile @@ -117,6 +117,7 @@ end group :test do gem 'capybara', '~> 3.38' + gem 'climate_control' gem 'faker', '~> 3.1' gem 'json-schema', '~> 3.0' gem 'rack-test', '~> 2.0' diff --git a/Gemfile.lock b/Gemfile.lock index bd1aece57..e5ad5bfe5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -784,6 +784,7 @@ DEPENDENCIES capybara (~> 3.38) charlock_holmes (~> 0.7.7) chewy (~> 7.2) + climate_control cocoon (~> 1.2) color_diff (~> 0.1) concurrent-ruby diff --git a/spec/presenters/instance_presenter_spec.rb b/spec/presenters/instance_presenter_spec.rb index 29170a79a..795abd8b4 100644 --- a/spec/presenters/instance_presenter_spec.rb +++ b/spec/presenters/instance_presenter_spec.rb @@ -89,8 +89,28 @@ describe InstancePresenter do end describe '#source_url' do - it 'returns "https://github.com/mastodon/mastodon"' do - expect(instance_presenter.source_url).to eq('https://github.com/mastodon/mastodon') + context 'with the GITHUB_REPOSITORY env variable set' do + around do |example| + ClimateControl.modify GITHUB_REPOSITORY: 'other/repo' do + example.run + end + end + + it 'uses the env variable to build a repo URL' do + expect(instance_presenter.source_url).to eq('https://github.com/other/repo') + end + end + + context 'without the GITHUB_REPOSITORY env variable set' do + around do |example| + ClimateControl.modify GITHUB_REPOSITORY: nil do + example.run + end + end + + it 'defaults to the core mastodon repo URL' do + expect(instance_presenter.source_url).to eq('https://github.com/mastodon/mastodon') + end end end -- cgit From 53309fa31a4106500e2da80b845fad08d7d09900 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Mar 2023 11:12:06 +0100 Subject: Bump puma from 6.1.0 to 6.1.1 (#24045) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Gemfile.lock') diff --git a/Gemfile.lock b/Gemfile.lock index e5ad5bfe5..8fbb7c5d1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -497,7 +497,7 @@ GEM premailer (~> 1.7, >= 1.7.9) private_address_check (0.5.0) public_suffix (5.0.1) - puma (6.1.0) + puma (6.1.1) nio4r (~> 2.0) pundit (2.3.0) activesupport (>= 3.0.0) -- cgit From 540d49ec143094e94996b04ba06ae8bdfd092ba8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Mar 2023 14:08:10 +0100 Subject: Bump pghero from 3.1.0 to 3.2.0 (#24044) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Gemfile.lock') diff --git a/Gemfile.lock b/Gemfile.lock index 8fbb7c5d1..df3385cf3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -483,7 +483,7 @@ GEM pastel (0.8.0) tty-color (~> 0.5) pg (1.4.6) - pghero (3.1.0) + pghero (3.2.0) activerecord (>= 6) pkg-config (1.5.1) posix-spawn (0.3.15) -- cgit From 43ec9d24f935d6d1858a7c96f33815c51860e988 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 11:32:15 +0100 Subject: Bump pghero from 3.2.0 to 3.3.0 (#24085) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Gemfile.lock') diff --git a/Gemfile.lock b/Gemfile.lock index df3385cf3..9227e5cb8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -483,7 +483,7 @@ GEM pastel (0.8.0) tty-color (~> 0.5) pg (1.4.6) - pghero (3.2.0) + pghero (3.3.0) activerecord (>= 6) pkg-config (1.5.1) posix-spawn (0.3.15) -- cgit From 82d7b08fcf49787196a5b2ee62ed55f37ae6229b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 14:50:08 +0100 Subject: Bump rack from 2.2.6.3 to 2.2.6.4 (#24097) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Gemfile.lock') diff --git a/Gemfile.lock b/Gemfile.lock index 9227e5cb8..1a48c25d2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -503,7 +503,7 @@ GEM activesupport (>= 3.0.0) raabro (1.4.0) racc (1.6.2) - rack (2.2.6.3) + rack (2.2.6.4) rack-attack (6.6.1) rack (>= 1.0, < 3) rack-cors (1.1.1) -- cgit From 5b39d208046ee6b44c3c24d25b6bbf1010e3e8cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 14:50:19 +0100 Subject: Bump rails from 6.1.7.2 to 6.1.7.3 (#24096) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 106 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 53 insertions(+), 53 deletions(-) (limited to 'Gemfile.lock') diff --git a/Gemfile.lock b/Gemfile.lock index 1a48c25d2..02de43e00 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,40 +30,40 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.2) - actionpack (= 6.1.7.2) - activesupport (= 6.1.7.2) + actioncable (6.1.7.3) + actionpack (= 6.1.7.3) + activesupport (= 6.1.7.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.2) - actionpack (= 6.1.7.2) - activejob (= 6.1.7.2) - activerecord (= 6.1.7.2) - activestorage (= 6.1.7.2) - activesupport (= 6.1.7.2) + actionmailbox (6.1.7.3) + actionpack (= 6.1.7.3) + activejob (= 6.1.7.3) + activerecord (= 6.1.7.3) + activestorage (= 6.1.7.3) + activesupport (= 6.1.7.3) mail (>= 2.7.1) - actionmailer (6.1.7.2) - actionpack (= 6.1.7.2) - actionview (= 6.1.7.2) - activejob (= 6.1.7.2) - activesupport (= 6.1.7.2) + actionmailer (6.1.7.3) + actionpack (= 6.1.7.3) + actionview (= 6.1.7.3) + activejob (= 6.1.7.3) + activesupport (= 6.1.7.3) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.7.2) - actionview (= 6.1.7.2) - activesupport (= 6.1.7.2) + actionpack (6.1.7.3) + actionview (= 6.1.7.3) + activesupport (= 6.1.7.3) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.2) - actionpack (= 6.1.7.2) - activerecord (= 6.1.7.2) - activestorage (= 6.1.7.2) - activesupport (= 6.1.7.2) + actiontext (6.1.7.3) + actionpack (= 6.1.7.3) + activerecord (= 6.1.7.3) + activestorage (= 6.1.7.3) + activesupport (= 6.1.7.3) nokogiri (>= 1.8.5) - actionview (6.1.7.2) - activesupport (= 6.1.7.2) + actionview (6.1.7.3) + activesupport (= 6.1.7.3) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -74,22 +74,22 @@ GEM case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) active_record_query_trace (1.8) - activejob (6.1.7.2) - activesupport (= 6.1.7.2) + activejob (6.1.7.3) + activesupport (= 6.1.7.3) globalid (>= 0.3.6) - activemodel (6.1.7.2) - activesupport (= 6.1.7.2) - activerecord (6.1.7.2) - activemodel (= 6.1.7.2) - activesupport (= 6.1.7.2) - activestorage (6.1.7.2) - actionpack (= 6.1.7.2) - activejob (= 6.1.7.2) - activerecord (= 6.1.7.2) - activesupport (= 6.1.7.2) + activemodel (6.1.7.3) + activesupport (= 6.1.7.3) + activerecord (6.1.7.3) + activemodel (= 6.1.7.3) + activesupport (= 6.1.7.3) + activestorage (6.1.7.3) + actionpack (= 6.1.7.3) + activejob (= 6.1.7.3) + activerecord (= 6.1.7.3) + activesupport (= 6.1.7.3) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.2) + activesupport (6.1.7.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -518,20 +518,20 @@ GEM rack rack-test (2.0.2) rack (>= 1.3) - rails (6.1.7.2) - actioncable (= 6.1.7.2) - actionmailbox (= 6.1.7.2) - actionmailer (= 6.1.7.2) - actionpack (= 6.1.7.2) - actiontext (= 6.1.7.2) - actionview (= 6.1.7.2) - activejob (= 6.1.7.2) - activemodel (= 6.1.7.2) - activerecord (= 6.1.7.2) - activestorage (= 6.1.7.2) - activesupport (= 6.1.7.2) + rails (6.1.7.3) + actioncable (= 6.1.7.3) + actionmailbox (= 6.1.7.3) + actionmailer (= 6.1.7.3) + actionpack (= 6.1.7.3) + actiontext (= 6.1.7.3) + actionview (= 6.1.7.3) + activejob (= 6.1.7.3) + activemodel (= 6.1.7.3) + activerecord (= 6.1.7.3) + activestorage (= 6.1.7.3) + activesupport (= 6.1.7.3) bundler (>= 1.15.0) - railties (= 6.1.7.2) + railties (= 6.1.7.3) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -545,9 +545,9 @@ GEM rails-i18n (6.0.0) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 7) - railties (6.1.7.2) - actionpack (= 6.1.7.2) - activesupport (= 6.1.7.2) + railties (6.1.7.3) + actionpack (= 6.1.7.3) + activesupport (= 6.1.7.3) method_source rake (>= 12.2) thor (~> 1.0) -- cgit From f4f3e2b46e619fcc2eda48c2eb66c517b4f466aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 14:55:42 +0100 Subject: Bump rubocop from 1.48.0 to 1.48.1 (#24095) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Gemfile.lock') diff --git a/Gemfile.lock b/Gemfile.lock index 02de43e00..5904ed804 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -477,7 +477,7 @@ GEM orm_adapter (0.5.0) ox (2.14.14) parallel (1.22.1) - parser (3.2.1.0) + parser (3.2.1.1) ast (~> 2.4.1) parslet (2.0.0) pastel (0.8.0) @@ -599,7 +599,7 @@ GEM rspec_chunked (0.6) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.48.0) + rubocop (1.48.1) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) -- cgit From 75131e7bf7f3d96cf325e674e6b76b0096382e99 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Tue, 14 Mar 2023 23:15:36 -0400 Subject: Setup haml-lint CI with todo config (#23524) --- .github/workflows/haml-lint-problem-matcher.json | 17 +++ .github/workflows/lint-haml.yml | 44 +++++++ .haml-lint.yml | 103 +---------------- .haml-lint_todo.yml | 128 +++++++++++++++++++++ Gemfile | 1 + Gemfile.lock | 8 ++ app/views/admin/accounts/show.html.haml | 8 +- app/views/admin/action_logs/index.html.haml | 2 +- app/views/admin/announcements/index.html.haml | 2 +- app/views/admin/disputes/appeals/index.html.haml | 2 +- app/views/admin/instances/index.html.haml | 2 +- app/views/admin/rules/index.html.haml | 2 +- app/views/admin/warning_presets/index.html.haml | 2 +- app/views/admin/webhooks/index.html.haml | 2 +- app/views/auth/sessions/two_factor.html.haml | 2 +- app/views/filters/_filter_fields.html.haml | 2 +- app/views/filters/index.html.haml | 2 +- app/views/kaminari/_next_page.html.haml | 16 +-- app/views/kaminari/_paginator.html.haml | 15 +-- app/views/kaminari/_prev_page.html.haml | 15 +-- app/views/layouts/modal.html.haml | 2 +- app/views/notification_mailer/_status.html.haml | 4 +- app/views/oauth/authorizations/show.html.haml | 2 +- app/views/settings/applications/index.html.haml | 2 +- app/views/settings/applications/show.html.haml | 4 +- .../settings/login_activities/index.html.haml | 2 +- app/views/statuses/_poll.html.haml | 2 +- 27 files changed, 248 insertions(+), 145 deletions(-) create mode 100644 .github/workflows/haml-lint-problem-matcher.json create mode 100644 .github/workflows/lint-haml.yml create mode 100644 .haml-lint_todo.yml (limited to 'Gemfile.lock') diff --git a/.github/workflows/haml-lint-problem-matcher.json b/.github/workflows/haml-lint-problem-matcher.json new file mode 100644 index 000000000..3523ea295 --- /dev/null +++ b/.github/workflows/haml-lint-problem-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "haml-lint", + "severity": "warning", + "pattern": [ + { + "regexp": "^(.*):(\\d+)\\s\\[W]\\s(.*):\\s(.*)$", + "file": 1, + "line": 2, + "code": 3, + "message": 4 + } + ] + } + ] +} diff --git a/.github/workflows/lint-haml.yml b/.github/workflows/lint-haml.yml new file mode 100644 index 000000000..a2b22a659 --- /dev/null +++ b/.github/workflows/lint-haml.yml @@ -0,0 +1,44 @@ +name: Haml Linting +on: + push: + branches-ignore: + - 'dependabot/**' + paths: + - '.github/workflows/haml-lint-problem-matcher.json' + - '.github/workflows/lint-haml.yml' + - '.haml-lint*.yml' + - '.rubocop*.yml' + - '.ruby-version' + - '**/*.haml' + - 'Gemfile*' + + pull_request: + paths: + - '.github/workflows/haml-lint-problem-matcher.json' + - '.github/workflows/lint-haml.yml' + - '.haml-lint*.yml' + - '.rubocop*.yml' + - '.ruby-version' + - '**/*.haml' + - 'Gemfile*' + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Install native Ruby dependencies + run: sudo apt-get install -y libicu-dev libidn11-dev + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Run haml-lint + run: | + echo "::add-matcher::.github/workflows/haml-lint-problem-matcher.json" + bundle exec haml-lint diff --git a/.haml-lint.yml b/.haml-lint.yml index 7853d81d7..12ca46342 100644 --- a/.haml-lint.yml +++ b/.haml-lint.yml @@ -1,108 +1,9 @@ -# Whether to ignore frontmatter at the beginning of HAML documents for -# frameworks such as Jekyll/Middleman -skip_frontmatter: false +inherits_from: .haml-lint_todo.yml exclude: - 'vendor/**/*' - - 'spec/**/*' - - 'lib/templates/**/*' - - 'app/views/kaminari/**/*' + - lib/templates/haml/scaffold/_form.html.haml linters: AltText: - enabled: false - - ClassAttributeWithStaticValue: - enabled: true - - ClassesBeforeIds: - enabled: true - - ConsecutiveComments: - enabled: true - - ConsecutiveSilentScripts: - enabled: true - max_consecutive: 2 - - EmptyObjectReference: - enabled: true - - EmptyScript: - enabled: true - - FinalNewline: - enabled: true - present: true - - HtmlAttributes: - enabled: true - - ImplicitDiv: - enabled: true - - LeadingCommentSpace: - enabled: true - - LineLength: - enabled: false - max: 80 - - MultilinePipe: - enabled: true - - MultilineScript: - enabled: true - - ObjectReferenceAttributes: - enabled: true - - RuboCop: - enabled: true - # These cops are incredibly noisy when it comes to HAML templates, so we - # ignore them. - ignored_cops: - - Lint/BlockAlignment - - Lint/EndAlignment - - Lint/Void - - Metrics/BlockLength - - Metrics/LineLength - - Style/AlignParameters - - Style/BlockNesting - - Style/ElseAlignment - - Style/EndOfLine - - Style/FileName - - Style/FinalNewline - - Style/FrozenStringLiteralComment - - Style/IfUnlessModifier - - Style/IndentationWidth - - Style/Next - - Style/TrailingBlankLines - - Style/TrailingWhitespace - - Style/WhileUntilModifier - - RubyComments: - enabled: true - - SpaceBeforeScript: - enabled: true - - SpaceInsideHashAttributes: - enabled: true - style: space - - Indentation: - enabled: true - character: space # or tab - - TagName: - enabled: true - - TrailingWhitespace: - enabled: true - - UnnecessaryInterpolation: - enabled: true - - UnnecessaryStringOutput: enabled: true diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml new file mode 100644 index 000000000..203010b04 --- /dev/null +++ b/.haml-lint_todo.yml @@ -0,0 +1,128 @@ +# This configuration was generated by +# `haml-lint --auto-gen-config` +# on 2023-02-11 02:16:03 -0500 using Haml-Lint version 0.45.0. +# The point is for the user to remove these configuration records +# one by one as the lints are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of Haml-Lint, may require this file to be generated again. + +linters: + # Offense count: 76 + RuboCop: + exclude: + - 'app/views/accounts/_og.html.haml' + - 'app/views/admin/account_actions/new.html.haml' + - 'app/views/admin/account_warnings/_account_warning.html.haml' + - 'app/views/admin/accounts/index.html.haml' + - 'app/views/admin/accounts/show.html.haml' + - 'app/views/admin/action_logs/index.html.haml' + - 'app/views/admin/announcements/edit.html.haml' + - 'app/views/admin/announcements/new.html.haml' + - 'app/views/admin/change_emails/show.html.haml' + - 'app/views/admin/custom_emojis/index.html.haml' + - 'app/views/admin/dashboard/index.html.haml' + - 'app/views/admin/disputes/appeals/_appeal.html.haml' + - 'app/views/admin/domain_blocks/edit.html.haml' + - 'app/views/admin/domain_blocks/new.html.haml' + - 'app/views/admin/ip_blocks/new.html.haml' + - 'app/views/admin/reports/actions/preview.html.haml' + - 'app/views/admin/reports/index.html.haml' + - 'app/views/admin/reports/show.html.haml' + - 'app/views/admin/roles/_form.html.haml' + - 'app/views/admin/settings/about/show.html.haml' + - 'app/views/admin/settings/appearance/show.html.haml' + - 'app/views/admin/settings/registrations/show.html.haml' + - 'app/views/admin/statuses/show.html.haml' + - 'app/views/application/_card.html.haml' + - 'app/views/application/_sidebar.html.haml' + - 'app/views/auth/registrations/_sessions.html.haml' + - 'app/views/auth/registrations/new.html.haml' + - 'app/views/auth/sessions/new.html.haml' + - 'app/views/disputes/strikes/show.html.haml' + - 'app/views/filters/_filter_fields.html.haml' + - 'app/views/invites/_form.html.haml' + - 'app/views/layouts/application.html.haml' + - 'app/views/layouts/error.html.haml' + - 'app/views/layouts/mailer.html.haml' + - 'app/views/notification_mailer/_status.html.haml' + - 'app/views/notification_mailer/favourite.html.haml' + - 'app/views/notification_mailer/follow_request.html.haml' + - 'app/views/oauth/authorizations/new.html.haml' + - 'app/views/oauth/authorized_applications/index.html.haml' + - 'app/views/settings/applications/_fields.html.haml' + - 'app/views/settings/imports/show.html.haml' + - 'app/views/settings/login_activities/_login_activity.html.haml' + - 'app/views/settings/preferences/appearance/show.html.haml' + - 'app/views/settings/preferences/other/show.html.haml' + - 'app/views/settings/preferences/other/show.html.haml' + - 'app/views/statuses_cleanup/show.html.haml' + - 'app/views/statuses/_detailed_status.html.haml' + - 'app/views/statuses/_og_image.html.haml' + - 'app/views/statuses/_poll.html.haml' + - 'app/views/statuses/_status.html.haml' + - 'app/views/statuses/show.html.haml' + - 'app/views/user_mailer/suspicious_sign_in.html.haml' + - 'app/views/user_mailer/warning.html.haml' + - 'app/views/user_mailer/webauthn_credential_added.html.haml' + - 'app/views/user_mailer/webauthn_credential_deleted.html.haml' + + # Offense count: 918 + LineLength: + enabled: false + + # Offense count: 22 + UnnecessaryStringOutput: + exclude: + - 'app/views/accounts/show.html.haml' + - 'app/views/admin/custom_emojis/_custom_emoji.html.haml' + - 'app/views/admin/relays/_relay.html.haml' + - 'app/views/admin/rules/_rule.html.haml' + - 'app/views/admin/statuses/index.html.haml' + - 'app/views/auth/registrations/_sessions.html.haml' + - 'app/views/disputes/strikes/show.html.haml' + - 'app/views/notification_mailer/_status.html.haml' + - 'app/views/settings/two_factor_authentication_methods/index.html.haml' + - 'app/views/statuses/_detailed_status.html.haml' + - 'app/views/statuses/_poll.html.haml' + - 'app/views/statuses/_simple_status.html.haml' + - 'app/views/user_mailer/suspicious_sign_in.html.haml' + - 'app/views/user_mailer/webauthn_credential_added.html.haml' + - 'app/views/user_mailer/webauthn_credential_deleted.html.haml' + - 'app/views/user_mailer/welcome.html.haml' + + # Offense count: 3 + ViewLength: + exclude: + - 'app/views/admin/accounts/show.html.haml' + - 'app/views/admin/reports/show.html.haml' + - 'app/views/disputes/strikes/show.html.haml' + + # Offense count: 43 + InstanceVariables: + exclude: + - 'app/views/admin/reports/_actions.html.haml' + - 'app/views/admin/roles/_form.html.haml' + - 'app/views/admin/webhooks/_form.html.haml' + - 'app/views/application/_sidebar.html.haml' + - 'app/views/auth/registrations/_sessions.html.haml' + - 'app/views/auth/registrations/_status.html.haml' + - 'app/views/auth/sessions/two_factor/_otp_authentication_form.html.haml' + - 'app/views/authorize_interactions/_post_follow_actions.html.haml' + - 'app/views/invites/_form.html.haml' + - 'app/views/relationships/_account.html.haml' + - 'app/views/shared/_og.html.haml' + - 'app/views/statuses/_status.html.haml' + + # Offense count: 6 + ConsecutiveSilentScripts: + exclude: + - 'app/views/admin/settings/shared/_links.html.haml' + - 'app/views/settings/login_activities/_login_activity.html.haml' + - 'app/views/statuses/_poll.html.haml' + + # Offense count: 3 + IdNames: + exclude: + - 'app/views/authorize_interactions/error.html.haml' + - 'app/views/oauth/authorizations/error.html.haml' + - 'app/views/shared/_error_messages.html.haml' diff --git a/Gemfile b/Gemfile index 7a836b6ba..c7889118d 100644 --- a/Gemfile +++ b/Gemfile @@ -139,6 +139,7 @@ group :development do gem 'memory_profiler' gem 'brakeman', '~> 5.4', require: false gem 'bundler-audit', '~> 0.9', require: false + gem 'haml_lint', require: false gem 'capistrano', '~> 3.17' gem 'capistrano-rails', '~> 1.6' diff --git a/Gemfile.lock b/Gemfile.lock index 5904ed804..0041c24c7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -308,6 +308,12 @@ GEM activesupport (>= 5.1) haml (>= 4.0.6) railties (>= 5.1) + haml_lint (0.45.0) + haml (>= 4.0, < 6.2) + parallel (~> 1.10) + rainbow + rubocop (>= 0.50.0) + sysexits (~> 1.1) hashdiff (1.0.1) hashie (5.0.0) highline (2.0.3) @@ -687,6 +693,7 @@ GEM activesupport (>= 3) attr_required (>= 0.0.5) httpclient (>= 2.4) + sysexits (1.2.0) temple (0.10.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) @@ -804,6 +811,7 @@ DEPENDENCIES fog-openstack (~> 0.3) fuubar (~> 2.5) haml-rails (~> 2.0) + haml_lint hiredis (~> 0.6) htmlentities (~> 4.3) http (~> 5.1) diff --git a/app/views/admin/accounts/show.html.haml b/app/views/admin/accounts/show.html.haml index c8a9d33a7..f5ae88379 100644 --- a/app/views/admin/accounts/show.html.haml +++ b/app/views/admin/accounts/show.html.haml @@ -206,7 +206,7 @@ - if @deletion_request.present? = link_to t('admin.accounts.delete'), admin_account_path(@account.id), method: :delete, class: 'button button--destructive', data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, @account) - else - %div.action-buttons + .action-buttons %div - if @account.local? && @account.user_approved? = link_to t('admin.accounts.warn'), new_admin_account_action_path(@account.id, type: 'none'), class: 'button' if can?(:warn, @account) @@ -276,9 +276,9 @@ %hr.spacer/ - if @account.user&.invite_request&.text&.present? - %div.speech-bubble - %div.speech-bubble__bubble + .speech-bubble + .speech-bubble__bubble = @account.user&.invite_request&.text - %div.speech-bubble__owner + .speech-bubble__owner = admin_account_link_to @account = t('admin.accounts.invite_request_text') diff --git a/app/views/admin/action_logs/index.html.haml b/app/views/admin/action_logs/index.html.haml index d8b7132f5..e2992fb80 100644 --- a/app/views/admin/action_logs/index.html.haml +++ b/app/views/admin/action_logs/index.html.haml @@ -19,7 +19,7 @@ = select_tag :action_type, options_for_select(Admin::ActionLogFilter::ACTION_TYPE_MAP.keys.map { |key| [I18n.t("admin.action_logs.action_types.#{key}"), key]}, params[:action_type]), prompt: I18n.t('admin.accounts.moderation.all') - if @action_logs.empty? - %div.muted-hint.center-text + .muted-hint.center-text = t 'admin.action_logs.empty' - else .report-notes diff --git a/app/views/admin/announcements/index.html.haml b/app/views/admin/announcements/index.html.haml index 40f02b914..ce520f59d 100644 --- a/app/views/admin/announcements/index.html.haml +++ b/app/views/admin/announcements/index.html.haml @@ -12,7 +12,7 @@ %li= filter_link_to safe_join([t('admin.announcements.live'), "(#{number_with_delimiter(Announcement.published.count)})"], ' '), published: '1', unpublished: nil - if @announcements.empty? - %div.muted-hint.center-text + .muted-hint.center-text = t 'admin.announcements.empty' - else .announcements-list diff --git a/app/views/admin/disputes/appeals/index.html.haml b/app/views/admin/disputes/appeals/index.html.haml index dd6a6f403..602414550 100644 --- a/app/views/admin/disputes/appeals/index.html.haml +++ b/app/views/admin/disputes/appeals/index.html.haml @@ -13,7 +13,7 @@ %li= filter_link_to t('admin.trends.rejected'), status: 'rejected' - if @appeals.empty? - %div.muted-hint.center-text + .muted-hint.center-text = t 'admin.disputes.appeals.empty' - else .announcements-list diff --git a/app/views/admin/instances/index.html.haml b/app/views/admin/instances/index.html.haml index 8f7e3e67d..0bae70e31 100644 --- a/app/views/admin/instances/index.html.haml +++ b/app/views/admin/instances/index.html.haml @@ -47,7 +47,7 @@ %hr.spacer/ - if @instances.empty? - %div.muted-hint.center-text + .muted-hint.center-text = t 'admin.instances.empty' - else = render partial: 'instance', collection: @instances diff --git a/app/views/admin/rules/index.html.haml b/app/views/admin/rules/index.html.haml index 4fb993ad0..aa6a4c1b6 100644 --- a/app/views/admin/rules/index.html.haml +++ b/app/views/admin/rules/index.html.haml @@ -18,7 +18,7 @@ %hr.spacer/ - if @rules.empty? - %div.muted-hint.center-text + .muted-hint.center-text = t 'admin.rules.empty' - else .announcements-list diff --git a/app/views/admin/warning_presets/index.html.haml b/app/views/admin/warning_presets/index.html.haml index dbc23fa30..b26a13d96 100644 --- a/app/views/admin/warning_presets/index.html.haml +++ b/app/views/admin/warning_presets/index.html.haml @@ -17,7 +17,7 @@ %hr.spacer/ - if @warning_presets.empty? - %div.muted-hint.center-text + .muted-hint.center-text = t 'admin.warning_presets.empty' - else .announcements-list diff --git a/app/views/admin/webhooks/index.html.haml b/app/views/admin/webhooks/index.html.haml index e4499e078..603d0edd2 100644 --- a/app/views/admin/webhooks/index.html.haml +++ b/app/views/admin/webhooks/index.html.haml @@ -9,7 +9,7 @@ %hr.spacer/ - if @webhooks.empty? - %div.muted-hint.center-text + .muted-hint.center-text = t 'admin.webhooks.empty' - else .applications-list diff --git a/app/views/auth/sessions/two_factor.html.haml b/app/views/auth/sessions/two_factor.html.haml index b897a0422..20232d8dc 100644 --- a/app/views/auth/sessions/two_factor.html.haml +++ b/app/views/auth/sessions/two_factor.html.haml @@ -1,7 +1,7 @@ - content_for :page_title do = t('auth.login') -=javascript_pack_tag 'two_factor_authentication', crossorigin: 'anonymous' += javascript_pack_tag 'two_factor_authentication', crossorigin: 'anonymous' - if @webauthn_enabled = render partial: 'auth/sessions/two_factor/webauthn_form', locals: { hidden: @scheme_type != 'webauthn' } diff --git a/app/views/filters/_filter_fields.html.haml b/app/views/filters/_filter_fields.html.haml index c58978f5a..a554b55ff 100644 --- a/app/views/filters/_filter_fields.html.haml +++ b/app/views/filters/_filter_fields.html.haml @@ -35,6 +35,6 @@ = render 'keyword_fields', f: keyword %tfoot %tr - %td{ colspan: 3} + %td{ colspan: 3 } = link_to_add_association f, :keywords, class: 'table-action-link', partial: 'keyword_fields', 'data-association-insertion-node': '.keywords-table tbody', 'data-association-insertion-method': 'append' do = safe_join([fa_icon('plus'), t('filters.edit.add_keyword')]) diff --git a/app/views/filters/index.html.haml b/app/views/filters/index.html.haml index 0227526a4..9c84f796f 100644 --- a/app/views/filters/index.html.haml +++ b/app/views/filters/index.html.haml @@ -5,7 +5,7 @@ = link_to t('filters.new.title'), new_filter_path, class: 'button' - if @filters.empty? - %div.muted-hint.center-text= t 'filters.index.empty' + .muted-hint.center-text= t 'filters.index.empty' - else .applications-list = render partial: 'filter', collection: @filters diff --git a/app/views/kaminari/_next_page.html.haml b/app/views/kaminari/_next_page.html.haml index 30a3643d6..c44aea1f1 100644 --- a/app/views/kaminari/_next_page.html.haml +++ b/app/views/kaminari/_next_page.html.haml @@ -1,9 +1,11 @@ --# Link to the "Next" page --# available local variables --# url: url to the next page --# current_page: a page object for the currently displayed page --# total_pages: total number of pages --# per_page: number of items to fetch per page --# remote: data-remote +-# + Link to the "Next" page + available local variables + url: url to the next page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote + %span.next = link_to_unless current_page.last?, safe_join([t('pagination.next'), fa_icon('chevron-right')], ' '), url, rel: 'next', remote: remote diff --git a/app/views/kaminari/_paginator.html.haml b/app/views/kaminari/_paginator.html.haml index b1da236d5..4778f6279 100644 --- a/app/views/kaminari/_paginator.html.haml +++ b/app/views/kaminari/_paginator.html.haml @@ -1,10 +1,11 @@ --# The container tag --# available local variables --# current_page: a page object for the currently displayed page --# total_pages: total number of pages --# per_page: number of items to fetch per page --# remote: data-remote --# paginator: the paginator that renders the pagination tags inside +-# + The container tag + available local variables + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote + paginator: the paginator that renders the pagination tags inside = paginator.render do %nav.pagination = prev_page_tag unless current_page.first? diff --git a/app/views/kaminari/_prev_page.html.haml b/app/views/kaminari/_prev_page.html.haml index 1089e3566..284d6223b 100644 --- a/app/views/kaminari/_prev_page.html.haml +++ b/app/views/kaminari/_prev_page.html.haml @@ -1,9 +1,10 @@ --# Link to the "Previous" page --# available local variables --# url: url to the previous page --# current_page: a page object for the currently displayed page --# total_pages: total number of pages --# per_page: number of items to fetch per page --# remote: data-remote +-# + Link to the "Previous" page + available local variables + url: url to the previous page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote %span.prev = link_to_unless current_page.first?, safe_join([fa_icon('chevron-left'), t('pagination.prev')], ' '), url, rel: 'prev', remote: remote diff --git a/app/views/layouts/modal.html.haml b/app/views/layouts/modal.html.haml index bbdae602f..bd2dcc132 100644 --- a/app/views/layouts/modal.html.haml +++ b/app/views/layouts/modal.html.haml @@ -15,6 +15,6 @@ .modal-layout__mastodon %div - %img{alt: '', draggable: 'false', src: mascot_url } + %img{ alt: '', draggable: 'false', src: mascot_url } = render template: 'layouts/application' diff --git a/app/views/notification_mailer/_status.html.haml b/app/views/notification_mailer/_status.html.haml index e7cd5ba3e..03f49c73d 100644 --- a/app/views/notification_mailer/_status.html.haml +++ b/app/views/notification_mailer/_status.html.haml @@ -26,11 +26,11 @@ = "@#{status.account.pretty_acct}" - if status.spoiler_text? - %div.auto-dir + .auto-dir %p = status.spoiler_text - %div.auto-dir + .auto-dir = status_content_format(status) - if status.ordered_media_attachments.size > 0 diff --git a/app/views/oauth/authorizations/show.html.haml b/app/views/oauth/authorizations/show.html.haml index c3c9960d8..a5122a87f 100644 --- a/app/views/oauth/authorizations/show.html.haml +++ b/app/views/oauth/authorizations/show.html.haml @@ -3,5 +3,5 @@ %p= t('doorkeeper.authorizations.show.title') .input-copy .input-copy__wrapper - %input{ type: 'text', class: 'oauth-code', spellcheck: 'false', readonly: true, value: params[:code] } + %input.oauth-code{ type: 'text', spellcheck: 'false', readonly: true, value: params[:code] } %button{ type: :button }= t('generic.copy') diff --git a/app/views/settings/applications/index.html.haml b/app/views/settings/applications/index.html.haml index a1f904a3a..5c31d56bc 100644 --- a/app/views/settings/applications/index.html.haml +++ b/app/views/settings/applications/index.html.haml @@ -5,7 +5,7 @@ = link_to t('doorkeeper.applications.index.new'), new_settings_application_path, class: 'button' - if @applications.empty? - %div.muted-hint.center-text=t 'doorkeeper.applications.index.empty' + .muted-hint.center-text= t 'doorkeeper.applications.index.empty' - else .table-wrapper %table.table diff --git a/app/views/settings/applications/show.html.haml b/app/views/settings/applications/show.html.haml index 390682d6f..466a8ba34 100644 --- a/app/views/settings/applications/show.html.haml +++ b/app/views/settings/applications/show.html.haml @@ -6,7 +6,7 @@ .table-wrapper %table.table %tbody - %tr + %tr %th= t('doorkeeper.applications.show.application_id') %td %code= @application.uid @@ -15,7 +15,7 @@ %td %code= @application.secret %tr - %th{ rowspan: 2}= t('applications.your_token') + %th{ rowspan: 2 }= t('applications.your_token') %td %code= current_user.token_for_app(@application).token %tr diff --git a/app/views/settings/login_activities/index.html.haml b/app/views/settings/login_activities/index.html.haml index ce524fbef..6fb1bc34c 100644 --- a/app/views/settings/login_activities/index.html.haml +++ b/app/views/settings/login_activities/index.html.haml @@ -6,7 +6,7 @@ %hr.spacer/ - if @login_activities.empty? - %div.muted-hint.center-text + .muted-hint.center-text = t 'login_activities.empty' - else .announcements-list diff --git a/app/views/statuses/_poll.html.haml b/app/views/statuses/_poll.html.haml index d0f264095..248c6058c 100644 --- a/app/views/statuses/_poll.html.haml +++ b/app/views/statuses/_poll.html.haml @@ -21,7 +21,7 @@ %span.poll__chart - else %label.poll__option>< - %span.poll__input{ class: poll.multiple? ? 'checkbox' : nil}>< + %span.poll__input{ class: poll.multiple? ? 'checkbox' : nil }>< %span.poll__option__text = prerender_custom_emojis(h(option.title), status.emojis) .poll__footer -- cgit