Browse Source
- cli: followed upstream
- version.rb: followed upstream, since we can use environment variables for the suffix now
- lib/paperclip: chose their spoof detector
- lib/sanitize: merged h1-h6 into supported elements, allowed translated attribute
- config/environments: follow upstream
- config/initializers: follow upstream
- config/application.rb: follow upstream
- config/locales: translations with %{title} prefix were replaced with hardcoded "Mastodon:" prefixes, should be fixed afterwards
it's inconsistent anyway right now
- config/settings: removed settings that were removed in upstream
- config/routes: followed upstream, due to API restructurings. Is there some hometown-specific API stuff that might be missing now?
- spec/: followed upstream, might have lost hometown-specific tests, but I haven't found any on a quick check
- .ruby-version, Gemfile, etc.: upstream
- .github/workflows: upstream
- about: followed upstream, therefore the static homepage is gone :/
- credentials: moved federation into the settings_attributes
- lists: follow upstream, `:is_exclusive` -> `:exclusive`
- statuses: keep local only
- account_statuses_filter: still hide local only posts for anonymous users
- activitypub/activity/create:
- keep activity_pub_type in params
- text: use hometown's way for determining the content
- spoiler: use hometown's mechanism
- feed_manager: use upstream exclusive list mechanism
- plain_text_formatter: use upstream way with html decoding, as I'm not sure whether we still have the Nokogiri library(?) available
problem: might remove tags that we want to keep?
- text_formatter: follow upstream
- account: use upstream MENTION_RE expression
- backup: follow upstream for permission validation
- list: follow upstream, is_exclusive -> exclusive !! WE MIGHT NEED A MIGRATION!
- status: moved set_locality hook to the others
- user: delegates for settings (federation, autoplay, etc.) were removed upstream, follow them
- webhook: follow upstream
- initial_state_serializer: keep max_toot_chars
- list_serializer: follow rename of is_exclusive -> exclusive
Use upstream version, since the translation API got upgraded to v2.
Use upstream version of vote_validator.
- admin/webhooks/_form: add group for template
- settings/preferences/appearance/show: add new input for 'expand_usernames'
check: missing translations, especially for hints
- settings/preferences/other/show: added input groups for no_rss and default_privacy
check: missing translations, especially for hints
- settigngs/profiles: upstream removed verification banner, follow them
Followed upstream changes.
Incorporated upstream changes and put the local_only check back in the correct place.
Ignored hometown changes, take upstream version.
- actions/lists: follow exclusive list naming
- components/column_back_button: follow upstream router refactoring
- components/column_header: follow upstream router refactoring
- components/hashtag: keep hometown behaviour, add href to links
- components/media_gallery: merge alt text indicator into upstream
- components/status: merge timestamp click -> original page
- components/status_action_bar: upstream removed the share button, follow them
- components/status_content:
- still make remote usernames => check: does the new href work?
- make translate button always visible like upstream
- keep hometown-specific changes for Articles and other posts
- features/header: keep header link
- features/account_gallery/components/media_item: keep link
- features/audio/index: keep no media description indicator, merge upstream styles
- features/compose/components/compose_form:
- merge max chars logic
- merge federation dropdown
- features/compose/components/navigation_bar: keep href to profile
- features/compose/components/poll_form: keep "is multiple" toggle
- features/compose/index: keep column header
- features/follow_requests/components/account_authorize: keep external link
- features/list_editor/components/edit_list_form: overwritten from upstream
- features/list_timeline/index: overwritten from upstream
- features/components/follow_request: keep external link
- features/components/notification: keep external link
- features/picture_in_picture/components/footer: keep external link
- features/status/components/detailed_status: keep external link
- features/ui/components/boost_modal: keep external link
- features/ui/index: merge upstream changes
- features/video/: keep no media description indicator
- containers/status_container: overwrite with upstream
- locales: best-effort merge, but I wouldn't trust it. should be normalized in some way.
lets-bump-hometown-to-mastodon-4.2
2974 changed files with 78652 additions and 54997 deletions
@ -1,39 +0,0 @@
|
||||
version: '2' |
||||
checks: |
||||
argument-count: |
||||
enabled: false |
||||
complex-logic: |
||||
enabled: false |
||||
file-lines: |
||||
enabled: false |
||||
method-complexity: |
||||
enabled: false |
||||
method-count: |
||||
enabled: false |
||||
method-lines: |
||||
enabled: false |
||||
nested-control-flow: |
||||
enabled: false |
||||
return-statements: |
||||
enabled: false |
||||
similar-code: |
||||
enabled: false |
||||
identical-code: |
||||
enabled: false |
||||
plugins: |
||||
brakeman: |
||||
enabled: true |
||||
bundler-audit: |
||||
enabled: true |
||||
eslint: |
||||
enabled: false |
||||
rubocop: |
||||
enabled: false |
||||
sass-lint: |
||||
enabled: false |
||||
exclude_patterns: |
||||
- spec/ |
||||
- vendor/asset/ |
||||
|
||||
- app/javascript/mastodon/locales/**/*.json |
||||
- config/locales/**/*.yml |
||||
@ -1,56 +0,0 @@
|
||||
name: Bug Report |
||||
description: If something isn't working as expected |
||||
labels: [bug] |
||||
body: |
||||
- type: markdown |
||||
attributes: |
||||
value: | |
||||
Make sure that you are submitting a new bug that was not previously reported or already fixed. |
||||
|
||||
Please use a concise and distinct title for the issue. |
||||
- type: textarea |
||||
attributes: |
||||
label: Steps to reproduce the problem |
||||
description: What were you trying to do? |
||||
value: | |
||||
1. |
||||
2. |
||||
3. |
||||
... |
||||
validations: |
||||
required: true |
||||
- type: input |
||||
attributes: |
||||
label: Expected behaviour |
||||
description: What should have happened? |
||||
validations: |
||||
required: true |
||||
- type: input |
||||
attributes: |
||||
label: Actual behaviour |
||||
description: What happened? |
||||
validations: |
||||
required: true |
||||
- type: textarea |
||||
attributes: |
||||
label: Detailed description |
||||
validations: |
||||
required: false |
||||
- type: textarea |
||||
attributes: |
||||
label: Specifications |
||||
description: | |
||||
What version or commit hash of Mastodon did you find this bug in? |
||||
|
||||
If a front-end issue, what browser and operating systems were you using? |
||||
placeholder: | |
||||
Mastodon 3.5.3 (or Edge) |
||||
Ruby 2.7.6 (or v3.1.2) |
||||
Node.js 16.18.0 |
||||
|
||||
Google Chrome 106.0.5249.119 |
||||
Firefox 105.0.3 |
||||
|
||||
etc... |
||||
validations: |
||||
required: true |
||||
@ -0,0 +1,76 @@
|
||||
name: Bug Report (Web Interface) |
||||
description: If you are using Mastodon's web interface and something is not working as expected |
||||
labels: [bug, 'status/to triage', 'area/web interface'] |
||||
body: |
||||
- type: markdown |
||||
attributes: |
||||
value: | |
||||
Make sure that you are submitting a new bug that was not previously reported or already fixed. |
||||
|
||||
Please use a concise and distinct title for the issue. |
||||
- type: textarea |
||||
attributes: |
||||
label: Steps to reproduce the problem |
||||
description: What were you trying to do? |
||||
value: | |
||||
1. |
||||
2. |
||||
3. |
||||
... |
||||
validations: |
||||
required: true |
||||
- type: input |
||||
attributes: |
||||
label: Expected behaviour |
||||
description: What should have happened? |
||||
validations: |
||||
required: true |
||||
- type: input |
||||
attributes: |
||||
label: Actual behaviour |
||||
description: What happened? |
||||
validations: |
||||
required: true |
||||
- type: textarea |
||||
attributes: |
||||
label: Detailed description |
||||
validations: |
||||
required: false |
||||
- type: input |
||||
attributes: |
||||
label: Mastodon instance |
||||
description: The address of the Mastodon instance where you experienced the issue |
||||
placeholder: mastodon.social |
||||
validations: |
||||
required: true |
||||
- type: input |
||||
attributes: |
||||
label: Mastodon version |
||||
description: | |
||||
This is displayed at the bottom of the About page, eg. `v4.1.2+nightly-20230627` |
||||
placeholder: v4.1.2 |
||||
validations: |
||||
required: true |
||||
- type: input |
||||
attributes: |
||||
label: Browser name and version |
||||
description: | |
||||
What browser are you using when getting this bug? Please specify the version as well. |
||||
placeholder: Firefox 105.0.3 |
||||
validations: |
||||
required: true |
||||
- type: input |
||||
attributes: |
||||
label: Operating system |
||||
description: | |
||||
What OS are you running? Please specify the version as well. |
||||
placeholder: macOS 13.4.1 |
||||
validations: |
||||
required: true |
||||
- type: textarea |
||||
attributes: |
||||
label: Technical details |
||||
description: | |
||||
Any additional technical details you may have. This can include the full error log, inspector's output… |
||||
validations: |
||||
required: false |
||||
@ -0,0 +1,65 @@
|
||||
name: Bug Report (server / API) |
||||
description: | |
||||
If something is not working as expected, but is not from using the web interface. |
||||
labels: [bug, 'status/to triage'] |
||||
body: |
||||
- type: markdown |
||||
attributes: |
||||
value: | |
||||
Make sure that you are submitting a new bug that was not previously reported or already fixed. |
||||
|
||||
Please use a concise and distinct title for the issue. |
||||
- type: textarea |
||||
attributes: |
||||
label: Steps to reproduce the problem |
||||
description: What were you trying to do? |
||||
value: | |
||||
1. |
||||
2. |
||||
3. |
||||
... |
||||
validations: |
||||
required: true |
||||
- type: input |
||||
attributes: |
||||
label: Expected behaviour |
||||
description: What should have happened? |
||||
validations: |
||||
required: true |
||||
- type: input |
||||
attributes: |
||||
label: Actual behaviour |
||||
description: What happened? |
||||
validations: |
||||
required: true |
||||
- type: textarea |
||||
attributes: |
||||
label: Detailed description |
||||
validations: |
||||
required: false |
||||
- type: input |
||||
attributes: |
||||
label: Mastodon instance |
||||
description: The address of the Mastodon instance where you experienced the issue |
||||
placeholder: mastodon.social |
||||
validations: |
||||
required: false |
||||
- type: input |
||||
attributes: |
||||
label: Mastodon version |
||||
description: | |
||||
This is displayed at the bottom of the About page, eg. `v4.1.2+nightly-20230627` |
||||
placeholder: v4.1.2 |
||||
validations: |
||||
required: false |
||||
- type: textarea |
||||
attributes: |
||||
label: Technical details |
||||
description: | |
||||
Any additional technical details you may have, like logs or error traces |
||||
value: | |
||||
If this is happening on your own Mastodon server, please fill out those: |
||||
- Ruby version: (from `ruby --version`, eg. v3.1.2) |
||||
- Node.js version: (from `node --version`, eg. v18.16.0) |
||||
validations: |
||||
required: false |
||||
@ -0,0 +1,123 @@
|
||||
{ |
||||
$schema: 'https://docs.renovatebot.com/renovate-schema.json', |
||||
extends: [ |
||||
'config:base', |
||||
':dependencyDashboard', |
||||
':labels(dependencies)', |
||||
':maintainLockFilesMonthly', // update non-direct dependencies monthly |
||||
':prConcurrentLimit10', // only 10 open PRs at the same time |
||||
], |
||||
stabilityDays: 3, // Wait 3 days after the package has been published before upgrading it |
||||
// packageRules order is important, they are applied from top to bottom and are merged, |
||||
// meaning the most important ones must be at the bottom, for example grouping rules |
||||
// If we do not want a package to be grouped with others, we need to set its groupName |
||||
// to `null` after any other rule set it to something. |
||||
packageRules: [ |
||||
{ |
||||
// Ignore major version bumps for these node packages |
||||
matchManagers: ['npm'], |
||||
matchPackageNames: [ |
||||
'tesseract.js', // Requires code changes |
||||
'react-hotkeys', // Requires code changes |
||||
|
||||
// Requires Webpacker upgrade or replacement |
||||
'@types/webpack', |
||||
'babel-loader', |
||||
'compression-webpack-plugin', |
||||
'css-loader', |
||||
'imports-loader', |
||||
'mini-css-extract-plugin', |
||||
'postcss-loader', |
||||
'sass-loader', |
||||
'terser-webpack-plugin', |
||||
'webpack', |
||||
'webpack-assets-manifest', |
||||
'webpack-bundle-analyzer', |
||||
'webpack-dev-server', |
||||
'webpack-cli', |
||||
|
||||
// react-router: Requires manual upgrade |
||||
'history', |
||||
'react-router-dom', |
||||
], |
||||
matchUpdateTypes: ['major'], |
||||
enabled: false, |
||||
}, |
||||
{ |
||||
// Ignore major version bumps for these Ruby packages |
||||
matchManagers: ['bundler'], |
||||
matchPackageNames: [ |
||||
'rack', // Needs to be synced with Rails version |
||||
'sprockets', // Requires manual upgrade https://github.com/rails/sprockets/blob/master/UPGRADING.md#guide-to-upgrading-from-sprockets-3x-to-4x |
||||
'strong_migrations', // Requires manual upgrade |
||||
'sidekiq', // Requires manual upgrade |
||||
'sidekiq-unique-jobs', // Requires manual upgrades and sync with Sidekiq version |
||||
'redis', // Requires manual upgrade and sync with Sidekiq version |
||||
], |
||||
matchUpdateTypes: ['major'], |
||||
enabled: false, |
||||
}, |
||||
{ |
||||
// Update Github Actions and Docker images weekly |
||||
matchManagers: ['github-actions', 'dockerfile', 'docker-compose'], |
||||
extends: ['schedule:weekly'], |
||||
}, |
||||
{ |
||||
// Ignore major & minor bumps for the ruby image, this needs to be synced with .ruby-version |
||||
matchManagers: ['dockerfile'], |
||||
matchPackageNames: ['moritzheiber/ruby-jemalloc'], |
||||
matchUpdateTypes: ['minor', 'major'], |
||||
enabled: false, |
||||
}, |
||||
{ |
||||
// Ignore major bump for the node image, this needs to be synced with .nvmrc |
||||
matchManagers: ['dockerfile'], |
||||
matchPackageNames: ['node'], |
||||
matchUpdateTypes: ['major'], |
||||
enabled: false, |
||||
}, |
||||
{ |
||||
// Ignore major postgres bumps in the docker-compose file, as those break dev environments |
||||
matchManagers: ['docker-compose'], |
||||
matchPackageNames: ['postgres'], |
||||
matchUpdateTypes: ['major'], |
||||
enabled: false, |
||||
}, |
||||
{ |
||||
// Update devDependencies every week, with one grouped PR |
||||
matchDepTypes: 'devDependencies', |
||||
matchUpdateTypes: ['patch', 'minor'], |
||||
groupName: 'devDependencies (non-major)', |
||||
extends: ['schedule:weekly'], |
||||
}, |
||||
{ |
||||
// Group all eslint-related packages with `eslint` in the same PR |
||||
matchManagers: ['npm'], |
||||
matchPackageNames: ['eslint'], |
||||
matchPackagePrefixes: ['eslint-', '@typescript-eslint/'], |
||||
matchUpdateTypes: ['patch', 'minor'], |
||||
groupName: 'eslint (non-major)', |
||||
}, |
||||
{ |
||||
// Update @types/* packages every week, with one grouped PR |
||||
matchPackagePrefixes: '@types/', |
||||
matchUpdateTypes: ['patch', 'minor'], |
||||
groupName: 'DefinitelyTyped types (non-major)', |
||||
extends: ['schedule:weekly'], |
||||
addLabels: ['typescript'], |
||||
}, |
||||
{ |
||||
// We want those packages to always have their own PR |
||||
matchManagers: ['npm'], |
||||
matchPackageNames: [ |
||||
'typescript', // Typescript has code-impacting changes in minor versions |
||||
], |
||||
groupName: null, // We dont want them to belong to any group |
||||
}, |
||||
// Add labels depending on package manager |
||||
{ matchManagers: ['npm', 'nvm'], addLabels: ['javascript'] }, |
||||
{ matchManagers: ['bundler', 'ruby-version'], addLabels: ['ruby'] }, |
||||
{ matchManagers: ['docker-compose', 'dockerfile'], addLabels: ['docker'] }, |
||||
{ matchManagers: ['github-actions'], addLabels: ['github_actions'] }, |
||||
], |
||||
} |
||||
@ -0,0 +1,42 @@
|
||||
name: Build nightly container image |
||||
on: |
||||
workflow_dispatch: |
||||
schedule: |
||||
- cron: '0 2 * * *' # run at 2 AM UTC |
||||
|
||||
permissions: |
||||
contents: read |
||||
packages: write |
||||
|
||||
jobs: |
||||
compute-suffix: |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- id: version_vars |
||||
env: |
||||
TZ: Etc/UTC |
||||
run: | |
||||
echo mastodon_version_suffix=nightly-$(date +'%Y-%m-%d')>> $GITHUB_OUTPUT |
||||
outputs: |
||||
suffix: ${{ steps.version_vars.outputs.mastodon_version_suffix }} |
||||
|
||||
build-image: |
||||
needs: compute-suffix |
||||
uses: ./.github/workflows/build-container-image.yml |
||||
with: |
||||
platforms: linux/amd64,linux/arm64 |
||||
use_native_arm64_builder: true |
||||
push_to_images: | |
||||
tootsuite/mastodon |
||||
ghcr.io/mastodon/mastodon |
||||
# The `+` is important here, result will be v4.1.2+nightly-2022-03-05 |
||||
version_suffix: +${{ needs.compute-suffix.outputs.suffix }} |
||||
labels: | |
||||
org.opencontainers.image.description=Nightly build image used for testing purposes |
||||
flavor: | |
||||
latest=auto |
||||
tags: | |
||||
type=raw,value=edge |
||||
type=raw,value=nightly |
||||
type=schedule,pattern=${{ needs.compute-suffix.outputs.suffix }} |
||||
secrets: inherit |
||||
@ -0,0 +1,41 @@
|
||||
name: Build container image for PR |
||||
on: |
||||
pull_request: |
||||
types: [labeled, synchronize, reopened, ready_for_review, opened] |
||||
|
||||
permissions: |
||||
contents: read |
||||
packages: write |
||||
|
||||
jobs: |
||||
compute-suffix: |
||||
runs-on: ubuntu-latest |
||||
# This is only allowed to run if: |
||||
# - the PR branch is in the `mastodon/mastodon` repository |
||||
# - the PR is not a draft |
||||
# - the PR has the "build-image" label |
||||
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'build-image') }} |
||||
steps: |
||||
# Repository needs to be cloned so `git rev-parse` below works |
||||
- name: Clone repository |
||||
uses: actions/checkout@v3 |
||||
- id: version_vars |
||||
run: | |
||||
echo mastodon_version_suffix=+pr-${{ github.event.pull_request.number }}-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT |
||||
outputs: |
||||
suffix: ${{ steps.version_vars.outputs.mastodon_version_suffix }} |
||||
|
||||
build-image: |
||||
needs: compute-suffix |
||||
uses: ./.github/workflows/build-container-image.yml |
||||
with: |
||||
platforms: linux/amd64,linux/arm64 |
||||
use_native_arm64_builder: true |
||||
push_to_images: | |
||||
ghcr.io/mastodon/mastodon |
||||
version_suffix: ${{ needs.compute-suffix.outputs.suffix }} |
||||
flavor: | |
||||
latest=auto |
||||
tags: | |
||||
type=ref,event=pr |
||||
secrets: inherit |
||||
@ -0,0 +1,40 @@
|
||||
name: Bundler Audit |
||||
on: |
||||
push: |
||||
branches-ignore: |
||||
- 'dependabot/**' |
||||
paths: |
||||
- 'Gemfile*' |
||||
- '.ruby-version' |
||||
- '.bundler-audit.yml' |
||||
- '.github/workflows/bundler-audit.yml' |
||||
|
||||
pull_request: |
||||
paths: |
||||
- 'Gemfile*' |
||||
- '.ruby-version' |
||||
- '.bundler-audit.yml' |
||||
- '.github/workflows/bundler-audit.yml' |
||||
|
||||
schedule: |
||||
- cron: '0 5 * * 1' |
||||
|
||||
jobs: |
||||
security: |
||||
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 bundler-audit |
||||
run: bundle exec bundler-audit |
||||
@ -0,0 +1,76 @@
|
||||
name: Crowdin / Download translations |
||||
on: |
||||
schedule: |
||||
- cron: '17 4 * * *' # Every day |
||||
workflow_dispatch: |
||||
|
||||
permissions: |
||||
contents: write |
||||
pull-requests: write |
||||
|
||||
jobs: |
||||
download-translations: |
||||
runs-on: ubuntu-latest |
||||
|
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v3 |
||||
|
||||
- name: Increase Git http.postBuffer |
||||
# This is needed due to a bug in Ubuntu's cURL version? |
||||
# See https://github.com/orgs/community/discussions/55820 |
||||
run: | |
||||
git config --global http.version HTTP/1.1 |
||||
git config --global http.postBuffer 157286400 |
||||
|
||||
# Download the translation files from Crowdin |
||||
- name: crowdin action |
||||
uses: crowdin/github-action@v1 |
||||
with: |
||||
upload_sources: false |
||||
upload_translations: false |
||||
download_translations: true |
||||
crowdin_branch_name: main |
||||
push_translations: false |
||||
create_pull_request: false |
||||
env: |
||||
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }} |
||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} |
||||
|
||||
# As the files are extracted from a Docker container, they belong to root:root |
||||
# We need to fix this before the next steps |
||||
- name: Fix file permissions |
||||
run: sudo chown -R runner:docker . |
||||
|
||||
# This is needed to run the normalize step |
||||
- 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 i18n normalize task |
||||
run: bundle exec i18n-tasks normalize |
||||
|
||||
# Create or update the pull request |
||||
- name: Create Pull Request |
||||
uses: peter-evans/create-pull-request@v5.0.2 |
||||
with: |
||||
commit-message: 'New Crowdin translations' |
||||
title: 'New Crowdin Translations (automated)' |
||||
author: 'GitHub Actions <noreply@github.com>' |
||||
body: | |
||||
New Crowdin translations, automated with Github Actions |
||||
|
||||
See `.github/workflows/crowdin-download.yml` |
||||
|
||||
This PR will be updated every day with new translations. |
||||
|
||||
Due to a limitation in Github Actions, checks are not running on this PR without manual action. |
||||
If you want to run the checks, then close and re-open it. |
||||
branch: i18n/crowdin/translations |
||||
base: main |
||||
labels: i18n |
||||
@ -0,0 +1,35 @@
|
||||
name: Crowdin / Upload translations |
||||
|
||||
on: |
||||
push: |
||||
branches: |
||||
- main |
||||
paths: |
||||
- crowdin.yml |
||||
- app/javascript/mastodon/locales/en.json |
||||
- config/locales/en.yml |
||||
- config/locales/simple_form.en.yml |
||||
- config/locales/activerecord.en.yml |
||||
- config/locales/devise.en.yml |
||||
- config/locales/doorkeeper.en.yml |
||||
- .github/workflows/crowdin-upload.yml |
||||
|
||||
jobs: |
||||
upload-translations: |
||||
runs-on: ubuntu-latest |
||||
|
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v3 |
||||
|
||||
- name: crowdin action |
||||
uses: crowdin/github-action@v1 |
||||
with: |
||||
upload_sources: true |
||||
upload_translations: false |
||||
download_translations: false |
||||
crowdin_branch_name: main |
||||
|
||||
env: |
||||
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }} |
||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} |
||||
@ -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 |
||||
} |
||||
] |
||||
} |
||||
] |
||||
} |
||||
@ -0,0 +1,47 @@
|
||||
name: Haml Linting |
||||
on: |
||||
push: |
||||
branches-ignore: |
||||
- 'dependabot/**' |
||||
- 'renovate/**' |
||||
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 update |
||||
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 |
||||
@ -0,0 +1,44 @@
|
||||
name: Markdown Linting |
||||
on: |
||||
push: |
||||
branches-ignore: |
||||
- 'dependabot/**' |
||||
- 'renovate/**' |
||||
paths: |
||||
- '.github/workflows/lint-md.yml' |
||||
- '.nvmrc' |
||||
- '.prettier*' |
||||
- '**/*.md' |
||||
- '!AUTHORS.md' |
||||
- 'package.json' |
||||
- 'yarn.lock' |
||||
|
||||
pull_request: |
||||
paths: |
||||
- '.github/workflows/lint-md.yml' |
||||
- '.nvmrc' |
||||
- '.prettier*' |
||||
- '**/*.md' |
||||
- '!AUTHORS.md' |
||||
- 'package.json' |
||||
- 'yarn.lock' |
||||
|
||||
jobs: |
||||
lint: |
||||
runs-on: ubuntu-latest |
||||
|
||||
steps: |
||||
- name: Clone repository |
||||
uses: actions/checkout@v3 |
||||
|
||||
- name: Set up Node.js |
||||
uses: actions/setup-node@v3 |
||||
with: |
||||
cache: yarn |
||||
node-version-file: '.nvmrc' |
||||
|
||||
- name: Install all yarn packages |
||||
run: yarn --frozen-lockfile |
||||
|
||||
- name: Prettier |
||||
run: yarn lint:md |
||||
@ -0,0 +1,51 @@
|
||||
name: Ruby Linting |
||||
on: |
||||
push: |
||||
branches-ignore: |
||||
- 'dependabot/**' |
||||
- 'renovate/**' |
||||
paths: |
||||
- 'Gemfile*' |
||||
- '.rubocop*.yml' |
||||
- '.ruby-version' |
||||
- 'config/brakeman.ignore' |
||||
- '**/*.rb' |
||||
- '**/*.rake' |
||||
- '.github/workflows/lint-ruby.yml' |
||||
|
||||
pull_request: |
||||
paths: |
||||
- 'Gemfile*' |
||||
- '.rubocop*.yml' |
||||
- '.ruby-version' |
||||
- 'config/brakeman.ignore' |
||||
- '**/*.rb' |
||||
- '**/*.rake' |
||||
- '.github/workflows/lint-ruby.yml' |
||||
|
||||
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: Set-up RuboCop Problem Matcher |
||||
uses: r7kamura/rubocop-problem-matchers-action@v1 |
||||
|
||||
- name: Run rubocop |
||||
run: bundle exec rubocop |
||||
|
||||
- name: Run brakeman |
||||
if: always() # Run both checks, even if the first failed |
||||
run: bundle exec brakeman |
||||
@ -1,17 +1,27 @@
|
||||
name: PR Needs Rebase |
||||
|
||||
on: |
||||
push: |
||||
pull_request_target: |
||||
types: [synchronize] |
||||
schedule: |
||||
- cron: '0 * * * *' |
||||
|
||||
permissions: |
||||
pull-requests: write |
||||
|
||||
jobs: |
||||
label-rebase-needed: |
||||
runs-on: ubuntu-latest |
||||
|
||||
concurrency: |
||||
group: ${{ github.workflow }}-${{ github.ref }} |
||||
cancel-in-progress: true |
||||
|
||||
steps: |
||||
- name: Check for merge conflicts |
||||
uses: eps1lon/actions-label-merge-conflict@releases/2.x |
||||
with: |
||||
dirtyLabel: 'rebase needed :construction:' |
||||
repoToken: '${{ secrets.GITHUB_TOKEN }}' |
||||
commentOnClean: This pull request has resolved merge conflicts and is ready for review. |
||||
commentOnDirty: This pull request has merge conflicts that must be resolved before it can be merged. |
||||
retryMax: 30 |
||||
continueOnMissingPermissions: false |
||||
|
||||
@ -0,0 +1,48 @@
|
||||
name: JavaScript Testing |
||||
on: |
||||
push: |
||||
branches-ignore: |
||||
- 'dependabot/**' |
||||
- 'renovate/**' |
||||
paths: |
||||
- 'package.json' |
||||
- 'yarn.lock' |
||||
- '.nvmrc' |
||||
- '**/*.js' |
||||
- '**/*.jsx' |
||||
- '**/*.ts' |
||||
- '**/*.tsx' |
||||
- '**/*.snap' |
||||
- '.github/workflows/test-js.yml' |
||||
|
||||
pull_request: |
||||
paths: |
||||
- 'package.json' |
||||
- 'yarn.lock' |
||||
- '.nvmrc' |
||||
- '**/*.js' |
||||
- '**/*.jsx' |
||||
- '**/*.ts' |
||||
- '**/*.tsx' |
||||
- '**/*.snap' |
||||
- '.github/workflows/test-js.yml' |
||||
|
||||
jobs: |
||||
test: |
||||
runs-on: ubuntu-latest |
||||
|
||||
steps: |
||||
- name: Clone repository |
||||
uses: actions/checkout@v3 |
||||
|
||||
- name: Set up Node.js |
||||
uses: actions/setup-node@v3 |
||||
with: |
||||
cache: yarn |
||||
node-version-file: '.nvmrc' |
||||
|
||||
- name: Install all yarn packages |
||||
run: yarn --frozen-lockfile |
||||
|
||||
- name: Jest testing |
||||
run: yarn jest --reporters github-actions summary |
||||
@ -0,0 +1,111 @@
|
||||
name: Test one step migrations |
||||
on: |
||||
push: |
||||
branches-ignore: |
||||
- 'dependabot/**' |
||||
- 'renovate/**' |
||||
pull_request: |
||||
|
||||
jobs: |
||||
pre_job: |
||||
runs-on: ubuntu-latest |
||||
|
||||
outputs: |
||||
should_skip: ${{ steps.skip_check.outputs.should_skip }} |
||||
|
||||
steps: |
||||
- id: skip_check |
||||
uses: fkirc/skip-duplicate-actions@v5 |
||||
with: |
||||
paths: '["Gemfile*", ".ruby-version", "**/*.rb", ".github/workflows/test-migrations-one-step.yml", "lib/tasks/tests.rake"]' |
||||
|
||||
test: |
||||
runs-on: ubuntu-latest |
||||
needs: pre_job |
||||
if: needs.pre_job.outputs.should_skip != 'true' |
||||
|
||||
strategy: |
||||
fail-fast: false |
||||
|
||||
matrix: |
||||
postgres: |
||||
- 14-alpine |
||||
- 15-alpine |
||||
|
||||
services: |
||||
postgres: |
||||
image: postgres:${{ matrix.postgres}} |
||||
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-alpine |
||||
options: >- |
||||
--health-cmd "redis-cli ping" |
||||
--health-interval 10s |
||||
--health-timeout 5s |
||||
--health-retries 5 |
||||
ports: |
||||
- 6379:6379 |
||||
|
||||
env: |
||||
CONTINUOUS_INTEGRATION: true |
||||
DB_HOST: localhost |
||||
DB_USER: postgres |
||||
DB_PASS: postgres |
||||
DISABLE_SIMPLECOV: true |
||||
RAILS_ENV: test |
||||
BUNDLE_CLEAN: true |
||||
BUNDLE_FROZEN: true |
||||
BUNDLE_WITHOUT: 'development production' |
||||
BUNDLE_JOBS: 3 |
||||
BUNDLE_RETRY: 3 |
||||
|
||||
steps: |
||||
- uses: actions/checkout@v3 |
||||
|
||||
- name: Install native Ruby dependencies |
||||
run: | |
||||
sudo apt-get update |
||||
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 |
||||
|
||||
- name: Create database |
||||
run: './bin/rails db:create' |
||||
|
||||
- name: Run migrations up to v2.0.0 |
||||
run: './bin/rails db:migrate VERSION=20171010025614' |
||||
|
||||
- name: Populate database with test data |
||||
run: './bin/rails tests:migrations:populate_v2' |
||||
|
||||
- name: Run migrations up to v2.4.0 |
||||
run: './bin/rails db:migrate VERSION=20180514140000' |
||||
|
||||
- name: Populate database with test data |
||||
run: './bin/rails tests:migrations:populate_v2_4' |
||||
|
||||
- name: Run migrations up to v2.4.3 |
||||
run: './bin/rails db:migrate VERSION=20180707154237' |
||||
|
||||
- name: Populate database with test data |
||||
run: './bin/rails tests:migrations:populate_v2_4_3' |
||||
|
||||
- name: Run all remaining migrations |
||||
run: './bin/rails db:migrate' |
||||
|
||||
- name: Check migration result |
||||
run: './bin/rails tests:migrations:check_database' |
||||
@ -0,0 +1,119 @@
|
||||
name: Test two step migrations |
||||
on: |
||||
push: |
||||
branches-ignore: |
||||
- 'dependabot/**' |
||||
- 'renovate/**' |
||||
pull_request: |
||||
|
||||
jobs: |
||||
pre_job: |
||||
runs-on: ubuntu-latest |
||||
|
||||
outputs: |
||||
should_skip: ${{ steps.skip_check.outputs.should_skip }} |
||||
|
||||
steps: |
||||
- id: skip_check |
||||
uses: fkirc/skip-duplicate-actions@v5 |
||||
with: |
||||
paths: '["Gemfile*", ".ruby-version", "**/*.rb", ".github/workflows/test-migrations-two-step.yml", "lib/tasks/tests.rake"]' |
||||
|
||||
test: |
||||
runs-on: ubuntu-latest |
||||
needs: pre_job |
||||
if: needs.pre_job.outputs.should_skip != 'true' |
||||
|
||||
strategy: |
||||
fail-fast: false |
||||
|
||||
matrix: |
||||
postgres: |
||||
- 14-alpine |
||||
- 15-alpine |
||||
|
||||
services: |
||||
postgres: |
||||
image: postgres:${{ matrix.postgres}} |
||||
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-alpine |
||||
options: >- |
||||
--health-cmd "redis-cli ping" |
||||
--health-interval 10s |
||||
--health-timeout 5s |
||||
--health-retries 5 |
||||
ports: |
||||
- 6379:6379 |
||||
|
||||
env: |
||||
CONTINUOUS_INTEGRATION: true |
||||
DB_HOST: localhost |
||||
DB_USER: postgres |
||||
DB_PASS: postgres |
||||
DISABLE_SIMPLECOV: true |
||||
RAILS_ENV: test |
||||
BUNDLE_CLEAN: true |
||||
BUNDLE_FROZEN: true |
||||
BUNDLE_WITHOUT: 'development production' |
||||
BUNDLE_JOBS: 3 |
||||
BUNDLE_RETRY: 3 |
||||
|
||||
steps: |
||||
- uses: actions/checkout@v3 |
||||
|
||||
- name: Install native Ruby dependencies |
||||
run: | |
||||
sudo apt-get update |
||||
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 |
||||
|
||||
- name: Create database |
||||
run: './bin/rails db:create' |
||||
|
||||
- name: Run migrations up to v2.0.0 |
||||
run: './bin/rails db:migrate VERSION=20171010025614' |
||||
|
||||
- name: Populate database with test data |
||||
run: './bin/rails tests:migrations:populate_v2' |
||||
|
||||
- name: Run pre-deployment migrations up to v2.4.0 |
||||
run: './bin/rails db:migrate VERSION=20180514140000' |
||||
env: |
||||
SKIP_POST_DEPLOYMENT_MIGRATIONS: true |
||||
|
||||
- name: Populate database with test data |
||||
run: './bin/rails tests:migrations:populate_v2_4' |
||||
|
||||
- name: Run migrations up to v2.4.3 |
||||
run: './bin/rails db:migrate VERSION=20180707154237' |
||||
env: |
||||
SKIP_POST_DEPLOYMENT_MIGRATIONS: true |
||||
|
||||
- name: Populate database with test data |
||||
run: './bin/rails tests:migrations:populate_v2_4_3' |
||||
|
||||
- name: Run all remaining pre-deployment migrations |
||||
run: './bin/rails db:migrate' |
||||
env: |
||||
SKIP_POST_DEPLOYMENT_MIGRATIONS: true |
||||
|
||||
- name: Run all post-deployment migrations |
||||
run: './bin/rails db:migrate' |
||||
|
||||
- name: Check migration result |
||||
run: './bin/rails tests:migrations:check_database' |
||||
@ -0,0 +1,252 @@
|
||||
name: Ruby Testing |
||||
|
||||
on: |
||||
push: |
||||
branches-ignore: |
||||
- 'dependabot/**' |
||||
- 'renovate/**' |
||||
pull_request: |
||||
|
||||
env: |
||||
BUNDLE_CLEAN: true |
||||
BUNDLE_FROZEN: true |
||||
|
||||
concurrency: |
||||
group: ${{ github.workflow }}-${{ github.ref }} |
||||
cancel-in-progress: true |
||||
|
||||
jobs: |
||||
build: |
||||
runs-on: ubuntu-latest |
||||
|
||||
strategy: |
||||
fail-fast: true |
||||
matrix: |
||||
mode: |
||||
- production |
||||
- test |
||||
env: |
||||
RAILS_ENV: ${{ matrix.mode }} |
||||
BUNDLE_WITH: ${{ matrix.mode }} |
||||
OTP_SECRET: precompile_placeholder |
||||
SECRET_KEY_BASE: precompile_placeholder |
||||
|
||||
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 update |
||||
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 --frozen-lockfile --production |
||||
- 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 |
||||
if: matrix.mode == 'test' |
||||
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-alpine |
||||
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-alpine |
||||
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 |
||||
OIDC_ENABLED: true |
||||
OIDC_SCOPE: read |
||||
SAML_ENABLED: true |
||||
CAS_ENABLED: true |
||||
BUNDLE_WITH: 'pam_authentication test' |
||||
CI_JOBS: ${{ matrix.ci_job }}/4 |
||||
|
||||
strategy: |
||||
fail-fast: false |
||||
matrix: |
||||
ruby-version: |
||||
- '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: Update package index |
||||
run: sudo apt-get update |
||||
|
||||
- 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: Load database schema |
||||
run: './bin/rails db:create db:schema:load db:seed' |
||||
|
||||
- run: bundle exec rake rspec_chunked |
||||
|
||||
test-e2e: |
||||
name: End to End testing |
||||
runs-on: ubuntu-latest |
||||
|
||||
needs: |
||||
- build |
||||
|
||||
services: |
||||
postgres: |
||||
image: postgres:14-alpine |
||||
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-alpine |
||||
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 |
||||
BUNDLE_WITH: test |
||||
|
||||
strategy: |
||||
fail-fast: false |
||||
matrix: |
||||
ruby-version: |
||||
- '3.0' |
||||
- '3.1' |
||||
- '.ruby-version' |
||||
|
||||
steps: |
||||
- uses: actions/checkout@v3 |
||||
|
||||
- uses: actions/download-artifact@v3 |
||||
with: |
||||
path: './public' |
||||
name: ${{ github.sha }} |
||||
|
||||
- name: Update package index |
||||
run: sudo apt-get update |
||||
|
||||
- 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: Install additional system dependencies |
||||
run: sudo apt-get install -y ffmpeg imagemagick |
||||
|
||||
- name: Set up bundler cache |
||||
uses: ruby/setup-ruby@v1 |
||||
with: |
||||
ruby-version: ${{ matrix.ruby-version}} |
||||
bundler-cache: true |
||||
|
||||
- run: yarn --frozen-lockfile |
||||
|
||||
- name: Load database schema |
||||
run: './bin/rails db:create db:schema:load db:seed' |
||||
|
||||
- run: bundle exec rake spec:system |
||||
|
||||
- name: Archive logs |
||||
uses: actions/upload-artifact@v3 |
||||
if: failure() |
||||
with: |
||||
name: e2e-logs-${{ matrix.ruby-version }} |
||||
path: log/ |
||||
|
||||
- name: Archive test screenshots |
||||
uses: actions/upload-artifact@v3 |
||||
if: failure() |
||||
with: |
||||
name: e2e-screenshots |
||||
path: tmp/screenshots/ |
||||
@ -1,108 +1,14 @@
|
||||
# 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 |
||||
|
||||
require: |
||||
- ./lib/linter/haml_middle_dot.rb |
||||
|
||||
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: |
||||
MiddleDot: |
||||
enabled: true |
||||
|
||||
@ -0,0 +1,47 @@
|
||||
# This configuration was generated by |
||||
# `haml-lint --auto-gen-config` |
||||
# on 2023-07-20 09:47:50 -0400 using Haml-Lint version 0.48.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: 951 |
||||
LineLength: |
||||
enabled: false |
||||
|
||||
# Offense count: 22 |
||||
UnnecessaryStringOutput: |
||||
enabled: false |
||||
|
||||
# Offense count: 57 |
||||
RuboCop: |
||||
enabled: false |
||||
|
||||
# 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: 32 |
||||
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/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' |
||||
|
||||
# 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' |
||||
@ -0,0 +1,4 @@
|
||||
#!/bin/sh |
||||
. "$(dirname "$0")/_/husky.sh" |
||||
|
||||
yarn lint-staged |
||||
@ -1,3 +1,4 @@
|
||||
module.exports = { |
||||
singleQuote: true |
||||
singleQuote: true, |
||||
jsxSingleQuote: true |
||||
} |
||||
|
||||
@ -1 +1 @@
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/.apt/lib/x86_64-linux-gnu:/app/.apt/usr/lib/x86_64-linux-gnu/mesa:/app/.apt/usr/lib/x86_64-linux-gnu/pulseaudio |
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/.apt/lib/x86_64-linux-gnu:/app/.apt/usr/lib/x86_64-linux-gnu/mesa:/app/.apt/usr/lib/x86_64-linux-gnu/pulseaudio:/app/.apt/usr/lib/x86_64-linux-gnu/openblas-pthread |
||||
|
||||
@ -1,479 +1,202 @@
|
||||
# Can be removed once all rules are addressed or moved to this file as documented overrides |
||||
inherit_from: .rubocop_todo.yml |
||||
|
||||
# Used for merging with exclude lists with .rubocop_todo.yml |
||||
inherit_mode: |
||||
merge: |
||||
- Exclude |
||||
|
||||
require: |
||||
- rubocop-rails |
||||
- rubocop-rspec |
||||
- rubocop-performance |
||||
- rubocop-capybara |
||||
- ./lib/linter/rubocop_middle_dot |
||||
|
||||
AllCops: |
||||
TargetRubyVersion: 2.7 |
||||
TargetRubyVersion: 3.0 # Set to minimum supported version of CI |
||||
DisplayCopNames: true |
||||
DisplayStyleGuide: true |
||||
ExtraDetails: true |
||||
UseCache: true |
||||
CacheRootDirectory: tmp |
||||
NewCops: enable |
||||
NewCops: enable # Opt-in to newly added rules |
||||
Exclude: |
||||
- db/schema.rb |
||||
- 'app/views/**/*' |
||||
- 'config/**/*' |
||||
- 'bin/*' |
||||
- 'Rakefile' |
||||
- 'node_modules/**/*' |
||||
- 'Vagrantfile' |
||||
- 'vendor/**/*' |
||||
- 'lib/json_ld/*' |
||||
- 'lib/json_ld/*' # Generated files |
||||
- 'lib/templates/**/*' |
||||
|
||||
Bundler/OrderedGems: |
||||
Enabled: false |
||||
|
||||
Layout/AccessModifierIndentation: |
||||
EnforcedStyle: indent |
||||
|
||||
Layout/EmptyLineAfterMagicComment: |
||||
Enabled: false |
||||
|
||||
Layout/EmptyLineAfterGuardClause: |
||||
Enabled: false |
||||
|
||||
Layout/EmptyLineBetweenDefs: |
||||
AllowAdjacentOneLineDefs: true |
||||
|
||||
Layout/EmptyLinesAroundAttributeAccessor: |
||||
Enabled: true |
||||
|
||||
# Reason: Prefer Hashes without extreme indentation |
||||
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutfirsthashelementindentation |
||||
Layout/FirstHashElementIndentation: |
||||
EnforcedStyle: consistent |
||||
|
||||
Layout/HashAlignment: |
||||
Enabled: false |
||||
|
||||
Layout/SpaceAroundMethodCallOperator: |
||||
Enabled: true |
||||
|
||||
Layout/SpaceInsideHashLiteralBraces: |
||||
EnforcedStyle: space |
||||
|
||||
Lint/DeprecatedOpenSSLConstant: |
||||
Enabled: true |
||||
|
||||
Lint/DuplicateElsifCondition: |
||||
Enabled: true |
||||
|
||||
Lint/MixedRegexpCaptureTypes: |
||||
Enabled: true |
||||
|
||||
Lint/RaiseException: |
||||
Enabled: true |
||||
|
||||
Lint/StructNewOverride: |
||||
Enabled: true |
||||
# Reason: Currently disabled in .rubocop_todo.yml |
||||
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutlinelength |
||||
Layout/LineLength: |
||||
Max: 320 # Default of 120 causes a duplicate entry in generated todo file |
||||
|
||||
# Reason: |
||||
# https://docs.rubocop.org/rubocop/cops_lint.html#lintuselessaccessmodifier |
||||
Lint/UselessAccessModifier: |
||||
ContextCreatingMethods: |
||||
- class_methods |
||||
|
||||
Metrics/AbcSize: |
||||
Max: 34 # RuboCop default 17 |
||||
Exclude: |
||||
- 'lib/**/*cli*.rb' |
||||
- db/*migrate/**/* |
||||
- lib/paperclip/color_extractor.rb |
||||
- app/workers/scheduler/follow_recommendations_scheduler.rb |
||||
- app/services/activitypub/fetch*_service.rb |
||||
- lib/paperclip/**/* |
||||
CountRepeatedAttributes: false |
||||
AllowedMethods: |
||||
- update_media_attachments! |
||||
- account_link_to |
||||
- attempt_oembed |
||||
- build_crutches |
||||
- calculate_scores |
||||
- cc |
||||
- dump_actor! |
||||
- filter_from_home? |
||||
- hydrate |
||||
- import_bookmarks! |
||||
- import_relationships! |
||||
- initialize |
||||
- link_to_mention |
||||
- log_target |
||||
- matches_time_window? |
||||
- parse_metadata |
||||
- perform_statuses_search! |
||||
- privatize_media_attachments! |
||||
- process_update |
||||
- publish_media_attachments! |
||||
- remotable_attachment |
||||
- render_initial_state |
||||
- render_with_cache |
||||
- searchable_by |
||||
- self.cached_filters_for |
||||
- set_fetchable_attributes! |
||||
- signed_request_actor |
||||
- statuses_to_delete |
||||
- update_poll! |
||||
## Disable most Metrics/*Length cops |
||||
# Reason: those are often triggered and force significant refactors when this happend |
||||
# but the team feel they are not really improving the code quality. |
||||
|
||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocklength |
||||
Metrics/BlockLength: |
||||
Max: 55 |
||||
Exclude: |
||||
- 'lib/mastodon/*_cli.rb' |
||||
CountComments: false |
||||
CountAsOne: [array, heredoc] |
||||
AllowedMethods: |
||||
- task |
||||
- namespace |
||||
- class_methods |
||||
- included |
||||
|
||||
Metrics/BlockNesting: |
||||
Max: 3 |
||||
Exclude: |
||||
- 'lib/mastodon/*_cli.rb' |
||||
Enabled: false |
||||
|
||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsclasslength |
||||
Metrics/ClassLength: |
||||
CountComments: false |
||||
Max: 500 |
||||
CountAsOne: [array, heredoc] |
||||
Exclude: |
||||
- 'lib/mastodon/*_cli.rb' |
||||
|
||||
Metrics/CyclomaticComplexity: |
||||
Max: 12 |
||||
Exclude: |
||||
- lib/mastodon/*cli*.rb |
||||
- db/*migrate/**/* |
||||
AllowedMethods: |
||||
- attempt_oembed |
||||
- blocked? |
||||
- build_crutches |
||||
- calculate_scores |
||||
- cc |
||||
- discover_endpoint! |
||||
- filter_from_home? |
||||
- hydrate |
||||
- klass |
||||
- link_to_mention |
||||
- log_target |
||||
- matches_time_window? |
||||
- patch_for_forwarding! |
||||
- preprocess_attributes! |
||||
- process_update |
||||
- remotable_attachment |
||||
- scan_text! |
||||
- self.cached_filters_for |
||||
- set_fetchable_attributes! |
||||
- setup_redis_env_url |
||||
- update_media_attachments! |
||||
|
||||
Layout/LineLength: |
||||
Max: 140 # RuboCop default 120 |
||||
AllowHeredoc: true |
||||
AllowURI: true |
||||
IgnoreCopDirectives: true |
||||
AllowedPatterns: |
||||
# Allow comments to be long lines |
||||
- !ruby/regexp / \# .*$/ |
||||
- !ruby/regexp /^\# .*$/ |
||||
Exclude: |
||||
- lib/**/*cli*.rb |
||||
- db/*migrate/**/* |
||||
- db/seeds/**/* |
||||
Enabled: false |
||||
|
||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmethodlength |
||||
Metrics/MethodLength: |
||||
CountComments: false |
||||
CountAsOne: [array, heredoc] |
||||
Max: 25 # RuboCop default 10 |
||||
Exclude: |
||||
- 'lib/mastodon/*_cli.rb' |
||||
AllowedMethods: |
||||
- account_link_to |
||||
- attempt_oembed |
||||
- body_with_limit |
||||
- build_crutches |
||||
- cached_filters_for |
||||
- calculate_scores |
||||
- check_webfinger! |
||||
- clean_feeds! |
||||
- collection_items |
||||
- collection_presenter |
||||
- copy_account_notes! |
||||
- deduplicate_accounts! |
||||
- deduplicate_conversations! |
||||
- deduplicate_local_accounts! |
||||
- deduplicate_statuses! |
||||
- deduplicate_tags! |
||||
- deduplicate_users! |
||||
- discover_endpoint! |
||||
- extract_extra_uris_with_indices |
||||
- extract_hashtags_with_indices |
||||
- extract_mentions_or_lists_with_indices |
||||
- filter_from_home? |
||||
- from_elasticsearch |
||||
- handle_explicit_update! |
||||
- handle_mark_as_sensitive! |
||||
- hsl_to_rgb |
||||
- import_bookmarks! |
||||
- import_domain_blocks! |
||||
- import_relationships! |
||||
- ldap_options |
||||
- matches_time_window? |
||||
- outbox_presenter |
||||
- pam_get_user |
||||
- parallelize_with_progress |
||||
- parse_and_transform |
||||
- patch_for_forwarding! |
||||
- populate_home |
||||
- post_process_style |
||||
- preload_cache_collection_target_statuses |
||||
- privatize_media_attachments! |
||||
- provides_callback_for |
||||
- publish_media_attachments! |
||||
- relevant_account_timestamp |
||||
- remotable_attachment |
||||
- rgb_to_hsl |
||||
- rss_status_content_format |
||||
- set_fetchable_attributes! |
||||
- setup_redis_env_url |
||||
- signed_request_actor |
||||
- to_preview_card_attributes |
||||
- upgrade_storage_filesystem |
||||
- upgrade_storage_s3 |
||||
- user_settings_params |
||||
- hydrate |
||||
- cc |
||||
- self_destruct |
||||
Enabled: false |
||||
|
||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmodulelength |
||||
Metrics/ModuleLength: |
||||
CountComments: false |
||||
Max: 200 |
||||
CountAsOne: [array, heredoc] |
||||
|
||||
Metrics/ParameterLists: |
||||
Max: 5 # RuboCop default 5 |
||||
CountKeywordArgs: true # RuboCop default true |
||||
MaxOptionalParameters: 3 # RuboCop default 3 |
||||
Exclude: |
||||
- app/models/concerns/account_interactions.rb |
||||
- app/services/activitypub/fetch_remote_account_service.rb |
||||
- app/services/activitypub/fetch_remote_actor_service.rb |
||||
|
||||
Metrics/PerceivedComplexity: |
||||
Max: 16 # RuboCop default 8 |
||||
AllowedMethods: |
||||
- attempt_oembed |
||||
- build_crutches |
||||
- calculate_scores |
||||
- deduplicate_users! |
||||
- discover_endpoint! |
||||
- filter_from_home? |
||||
- hydrate |
||||
- patch_for_forwarding! |
||||
- process_update |
||||
- remove_orphans |
||||
- update_media_attachments! |
||||
|
||||
Naming/MemoizedInstanceVariableName: |
||||
Enabled: false |
||||
|
||||
Naming/MethodParameterName: |
||||
Enabled: true |
||||
## End Disable Metrics/*Length cops |
||||
|
||||
Rails: |
||||
Enabled: true |
||||
|
||||
Rails/ApplicationController: |
||||
Enabled: false |
||||
# Reason: Currently disabled in .rubocop_todo.yml |
||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsabcsize |
||||
Metrics/AbcSize: |
||||
Exclude: |
||||
- 'app/controllers/well_known/**/*.rb' |
||||
|
||||
Rails/BelongsTo: |
||||
Enabled: false |
||||
|
||||
Rails/ContentTag: |
||||
Enabled: false |
||||
|
||||
Rails/EnumHash: |
||||
Enabled: false |
||||
- 'lib/mastodon/cli/*.rb' |
||||
- db/*migrate/**/* |
||||
|
||||
Rails/Exit: |
||||
# Reason: |
||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocknesting |
||||
Metrics/BlockNesting: |
||||
Exclude: |
||||
- 'lib/mastodon/*' |
||||
- 'lib/cli.rb' |
||||
|
||||
Rails/FilePath: |
||||
Enabled: false |
||||
- 'lib/mastodon/cli/*.rb' |
||||
|
||||
Rails/HasAndBelongsToMany: |
||||
Enabled: false |
||||
# Reason: Currently disabled in .rubocop_todo.yml |
||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricscyclomaticcomplexity |
||||
Metrics/CyclomaticComplexity: |
||||
Exclude: |
||||
- lib/mastodon/cli/*.rb |
||||
- db/*migrate/**/* |
||||
|
||||
Rails/HasManyOrHasOneDependent: |
||||
Enabled: false |
||||
# Reason: |
||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsparameterlists |
||||
Metrics/ParameterLists: |
||||
CountKeywordArgs: false |
||||
|
||||
Rails/HelperInstanceVariable: |
||||
Enabled: false |
||||
# Reason: Prevailing style is argument file paths |
||||
# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsfilepath |
||||
Rails/FilePath: |
||||
EnforcedStyle: arguments |
||||
|
||||
# Reason: Prevailing style uses numeric status codes, matches RSpec/Rails/HttpStatus |
||||
# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railshttpstatus |
||||
Rails/HttpStatus: |
||||
Enabled: false |
||||
EnforcedStyle: numeric |
||||
|
||||
Rails/IndexBy: |
||||
Enabled: false |
||||
|
||||
Rails/InverseOf: |
||||
Enabled: false |
||||
|
||||
Rails/LexicallyScopedActionFilter: |
||||
Enabled: false |
||||
|
||||
Rails/OutputSafety: |
||||
Enabled: true |
||||
|
||||
Rails/RakeEnvironment: |
||||
Enabled: false |
||||
|
||||
Rails/RedundantForeignKey: |
||||
Enabled: false |
||||
|
||||
Rails/SkipsModelValidations: |
||||
Enabled: false |
||||
|
||||
Rails/UniqueValidationWithoutIndex: |
||||
Enabled: false |
||||
|
||||
Style/AccessorGrouping: |
||||
Enabled: true |
||||
|
||||
Style/AccessModifierDeclarations: |
||||
Enabled: false |
||||
# Reason: Allowed in `tootctl` CLI code and in boot ENV checker |
||||
# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsexit |
||||
Rails/Exit: |
||||
Exclude: |
||||
- 'config/boot.rb' |
||||
- 'lib/mastodon/cli/*.rb' |
||||
|
||||
# Reason: Some single letter camel case files shouldn't be split |
||||
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecfilepath |
||||
RSpec/FilePath: |
||||
CustomTransform: |
||||
ActivityPub: activitypub # Ignore the snake_case due to the amount of files to rename |
||||
DeepL: deepl |
||||
FetchOEmbedService: fetch_oembed_service |
||||
JsonLdHelper: jsonld_helper |
||||
OEmbedController: oembed_controller |
||||
OStatus: ostatus |
||||
NodeInfoController: nodeinfo_controller # NodeInfo isn't snake_cased for any of the instances |
||||
Exclude: |
||||
- 'spec/config/initializers/rack_attack_spec.rb' # namespaces usually have separate folder |
||||
- 'spec/lib/sanitize_config_spec.rb' # namespaces usually have separate folder |
||||
|
||||
Style/ArrayCoercion: |
||||
Enabled: true |
||||
# Reason: |
||||
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecnamedsubject |
||||
RSpec/NamedSubject: |
||||
EnforcedStyle: named_only |
||||
|
||||
Style/BisectedAttrAccessor: |
||||
Enabled: true |
||||
# Reason: Prevailing style choice |
||||
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecnottonot |
||||
RSpec/NotToNot: |
||||
EnforcedStyle: to_not |
||||
|
||||
Style/CaseLikeIf: |
||||
Enabled: false |
||||
# Reason: Prevailing style uses numeric status codes, matches Rails/HttpStatus |
||||
# https://docs.rubocop.org/rubocop-rspec/cops_rspec_rails.html#rspecrailshttpstatus |
||||
RSpec/Rails/HttpStatus: |
||||
EnforcedStyle: numeric |
||||
|
||||
# Reason: |
||||
# https://docs.rubocop.org/rubocop/cops_style.html#styleclassandmodulechildren |
||||
Style/ClassAndModuleChildren: |
||||
Enabled: false |
||||
|
||||
Style/CollectionMethods: |
||||
Enabled: true |
||||
PreferredMethods: |
||||
find_all: 'select' |
||||
|
||||
# Reason: Classes mostly self-document with their names |
||||
# https://docs.rubocop.org/rubocop/cops_style.html#styledocumentation |
||||
Style/Documentation: |
||||
Enabled: false |
||||
|
||||
Style/DoubleNegation: |
||||
Enabled: true |
||||
|
||||
Style/ExpandPathArguments: |
||||
Enabled: false |
||||
|
||||
Style/ExponentialNotation: |
||||
Enabled: true |
||||
|
||||
Style/FormatString: |
||||
Enabled: false |
||||
|
||||
Style/FormatStringToken: |
||||
Enabled: false |
||||
|
||||
Style/FrozenStringLiteralComment: |
||||
Enabled: true |
||||
|
||||
Style/GuardClause: |
||||
Enabled: false |
||||
|
||||
Style/HashAsLastArrayItem: |
||||
Enabled: false |
||||
|
||||
Style/HashEachMethods: |
||||
Enabled: true |
||||
|
||||
Style/HashLikeCase: |
||||
Enabled: true |
||||
|
||||
Style/HashTransformKeys: |
||||
Enabled: true |
||||
|
||||
Style/HashTransformValues: |
||||
Enabled: false |
||||
|
||||
# Reason: Enforce modern Ruby style |
||||
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashsyntax |
||||
Style/HashSyntax: |
||||
Enabled: true |
||||
EnforcedStyle: ruby19_no_mixed_keys |
||||
|
||||
Style/IfUnlessModifier: |
||||
Enabled: false |
||||
|
||||
Style/InverseMethods: |
||||
Enabled: false |
||||
|
||||
Style/Lambda: |
||||
Enabled: false |
||||
|
||||
Style/MutableConstant: |
||||
Enabled: false |
||||
# Reason: |
||||
# https://docs.rubocop.org/rubocop/cops_style.html#stylenumericliterals |
||||
Style/NumericLiterals: |
||||
AllowedPatterns: |
||||
- \d{4}_\d{2}_\d{2}_\d{6} # For DB migration date version number readability |
||||
|
||||
# Reason: |
||||
# https://docs.rubocop.org/rubocop/cops_style.html#stylepercentliteraldelimiters |
||||
Style/PercentLiteralDelimiters: |
||||
PreferredDelimiters: |
||||
'%i': '()' |
||||
'%w': '()' |
||||
|
||||
Style/PerlBackrefs: |
||||
AutoCorrect: false |
||||
|
||||
Style/RedundantFetchBlock: |
||||
Enabled: true |
||||
|
||||
Style/RedundantFileExtensionInRequire: |
||||
Enabled: true |
||||
|
||||
Style/RedundantRegexpCharacterClass: |
||||
Enabled: false |
||||
|
||||
Style/RedundantRegexpEscape: |
||||
Enabled: false |
||||
|
||||
Style/RedundantReturn: |
||||
Enabled: true |
||||
|
||||
# Reason: Prefer less indentation in conditional assignments |
||||
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantbegin |
||||
Style/RedundantBegin: |
||||
Enabled: false |
||||
|
||||
Style/RegexpLiteral: |
||||
Enabled: false |
||||
|
||||
# Reason: Overridden to reduce implicit StandardError rescues |
||||
# https://docs.rubocop.org/rubocop/cops_style.html#stylerescuestandarderror |
||||
Style/RescueStandardError: |
||||
Enabled: true |
||||
|
||||
Style/SignalException: |
||||
Enabled: false |
||||
EnforcedStyle: implicit |
||||
|
||||
Style/SlicingWithRange: |
||||
Enabled: true |
||||
# Reason: Simplify some spec layouts |
||||
# https://docs.rubocop.org/rubocop/cops_style.html#stylesemicolon |
||||
Style/Semicolon: |
||||
AllowAsExpressionSeparator: true |
||||
|
||||
# Reason: Originally disabled for CodeClimate, and no config consensus has been found |
||||
# https://docs.rubocop.org/rubocop/cops_style.html#stylesymbolarray |
||||
Style/SymbolArray: |
||||
Enabled: false |
||||
|
||||
# Reason: |
||||
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingcommainarrayliteral |
||||
Style/TrailingCommaInArrayLiteral: |
||||
EnforcedStyleForMultiline: 'comma' |
||||
|
||||
# Reason: |
||||
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingcommainhashliteral |
||||
Style/TrailingCommaInHashLiteral: |
||||
EnforcedStyleForMultiline: 'comma' |
||||
|
||||
Style/UnpackFirst: |
||||
Enabled: false |
||||
|
||||
RSpec/ScatteredSetup: |
||||
Enabled: false |
||||
RSpec/ImplicitExpect: |
||||
Enabled: false |
||||
RSpec/NamedSubject: |
||||
Enabled: false |
||||
RSpec/DescribeClass: |
||||
Enabled: false |
||||
RSpec/LetSetup: |
||||
Enabled: false |
||||
Style/MiddleDot: |
||||
Enabled: true |
||||
|
||||
@ -0,0 +1,854 @@
|
||||
# This configuration was generated by |
||||
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp` |
||||
# using RuboCop version 1.54.2. |
||||
# The point is for the user to remove these configuration records |
||||
# one by one as the offenses are removed from the code base. |
||||
# Note that changes in the inspected code, or installation of new |
||||
# versions of RuboCop, may require this file to be generated again. |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. |
||||
# Include: **/*.gemfile, **/Gemfile, **/gems.rb |
||||
Bundler/OrderedGems: |
||||
Exclude: |
||||
- 'Gemfile' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyle, IndentationWidth. |
||||
# SupportedStyles: with_first_argument, with_fixed_indentation |
||||
Layout/ArgumentAlignment: |
||||
Exclude: |
||||
- 'config/initializers/cors.rb' |
||||
- 'config/initializers/session_store.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. |
||||
# SupportedHashRocketStyles: key, separator, table |
||||
# SupportedColonStyles: key, separator, table |
||||
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit |
||||
Layout/HashAlignment: |
||||
Exclude: |
||||
- 'config/environments/production.rb' |
||||
- 'config/initializers/rack_attack.rb' |
||||
- 'config/routes.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. |
||||
Layout/LeadingCommentSpace: |
||||
Exclude: |
||||
- 'config/application.rb' |
||||
- 'config/initializers/omniauth.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. |
||||
# URISchemes: http, https |
||||
Layout/LineLength: |
||||
Exclude: |
||||
- 'app/models/account.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyle. |
||||
# SupportedStyles: require_no_space, require_space |
||||
Layout/SpaceInLambdaLiteral: |
||||
Exclude: |
||||
- 'config/environments/production.rb' |
||||
- 'config/initializers/content_security_policy.rb' |
||||
|
||||
# Configuration parameters: AllowComments, AllowEmptyLambdas. |
||||
Lint/EmptyBlock: |
||||
Exclude: |
||||
- 'spec/controllers/api/v2/search_controller_spec.rb' |
||||
- 'spec/fabricators/access_token_fabricator.rb' |
||||
- 'spec/fabricators/conversation_fabricator.rb' |
||||
- 'spec/fabricators/system_key_fabricator.rb' |
||||
- 'spec/helpers/admin/action_logs_helper_spec.rb' |
||||
- 'spec/lib/activitypub/adapter_spec.rb' |
||||
- 'spec/models/account_alias_spec.rb' |
||||
- 'spec/models/account_deletion_request_spec.rb' |
||||
- 'spec/models/account_moderation_note_spec.rb' |
||||
- 'spec/models/announcement_mute_spec.rb' |
||||
- 'spec/models/announcement_reaction_spec.rb' |
||||
- 'spec/models/announcement_spec.rb' |
||||
- 'spec/models/backup_spec.rb' |
||||
- 'spec/models/conversation_mute_spec.rb' |
||||
- 'spec/models/custom_filter_keyword_spec.rb' |
||||
- 'spec/models/custom_filter_spec.rb' |
||||
- 'spec/models/device_spec.rb' |
||||
- 'spec/models/encrypted_message_spec.rb' |
||||
- 'spec/models/featured_tag_spec.rb' |
||||
- 'spec/models/follow_recommendation_suppression_spec.rb' |
||||
- 'spec/models/list_account_spec.rb' |
||||
- 'spec/models/list_spec.rb' |
||||
- 'spec/models/login_activity_spec.rb' |
||||
- 'spec/models/mute_spec.rb' |
||||
- 'spec/models/preview_card_spec.rb' |
||||
- 'spec/models/preview_card_trend_spec.rb' |
||||
- 'spec/models/relay_spec.rb' |
||||
- 'spec/models/scheduled_status_spec.rb' |
||||
- 'spec/models/status_stat_spec.rb' |
||||
- 'spec/models/status_trend_spec.rb' |
||||
- 'spec/models/system_key_spec.rb' |
||||
- 'spec/models/tag_follow_spec.rb' |
||||
- 'spec/models/unavailable_domain_spec.rb' |
||||
- 'spec/models/user_invite_request_spec.rb' |
||||
- 'spec/models/user_role_spec.rb' |
||||
- 'spec/models/web/setting_spec.rb' |
||||
|
||||
Lint/NonLocalExitFromIterator: |
||||
Exclude: |
||||
- 'app/helpers/jsonld_helper.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
Lint/OrAssignmentToConstant: |
||||
Exclude: |
||||
- 'lib/sanitize_ext/sanitize_config.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. |
||||
Lint/UnusedBlockArgument: |
||||
Exclude: |
||||
- 'config/initializers/content_security_policy.rb' |
||||
- 'config/initializers/doorkeeper.rb' |
||||
- 'config/initializers/paperclip.rb' |
||||
- 'config/initializers/simple_form.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
Lint/UselessAssignment: |
||||
Exclude: |
||||
- 'app/services/activitypub/process_status_update_service.rb' |
||||
- 'config/initializers/omniauth.rb' |
||||
- 'db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb' |
||||
- 'db/post_migrate/20190511152737_remove_suspended_silenced_account_fields.rb' |
||||
- 'spec/controllers/api/v1/favourites_controller_spec.rb' |
||||
- 'spec/controllers/concerns/account_controller_concern_spec.rb' |
||||
- 'spec/helpers/jsonld_helper_spec.rb' |
||||
- 'spec/models/account_spec.rb' |
||||
- 'spec/models/domain_block_spec.rb' |
||||
- 'spec/models/status_spec.rb' |
||||
- 'spec/models/user_spec.rb' |
||||
- 'spec/models/webauthn_credentials_spec.rb' |
||||
- 'spec/services/account_search_service_spec.rb' |
||||
- 'spec/services/post_status_service_spec.rb' |
||||
- 'spec/services/precompute_feed_service_spec.rb' |
||||
- 'spec/services/resolve_url_service_spec.rb' |
||||
- 'spec/views/statuses/show.html.haml_spec.rb' |
||||
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. |
||||
Metrics/AbcSize: |
||||
Max: 146 |
||||
|
||||
# Configuration parameters: CountBlocks, Max. |
||||
Metrics/BlockNesting: |
||||
Exclude: |
||||
- 'lib/tasks/mastodon.rake' |
||||
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns. |
||||
Metrics/CyclomaticComplexity: |
||||
Max: 25 |
||||
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns. |
||||
Metrics/PerceivedComplexity: |
||||
Max: 27 |
||||
|
||||
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. |
||||
# SupportedStyles: snake_case, normalcase, non_integer |
||||
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 |
||||
Naming/VariableNumber: |
||||
Exclude: |
||||
- 'db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb' |
||||
- 'db/migrate/20180514140000_revert_index_change_on_statuses_for_api_v1_accounts_account_id_statuses.rb' |
||||
- 'db/migrate/20190820003045_update_statuses_index.rb' |
||||
- 'db/migrate/20190823221802_add_local_index_to_statuses.rb' |
||||
- 'db/migrate/20200119112504_add_public_index_to_statuses.rb' |
||||
- 'spec/models/account_spec.rb' |
||||
- 'spec/models/domain_block_spec.rb' |
||||
- 'spec/models/user_spec.rb' |
||||
|
||||
RSpec/AnyInstance: |
||||
Exclude: |
||||
- 'spec/controllers/activitypub/inboxes_controller_spec.rb' |
||||
- 'spec/controllers/admin/accounts_controller_spec.rb' |
||||
- 'spec/controllers/admin/resets_controller_spec.rb' |
||||
- 'spec/controllers/admin/settings/branding_controller_spec.rb' |
||||
- 'spec/controllers/api/v1/media_controller_spec.rb' |
||||
- 'spec/controllers/auth/sessions_controller_spec.rb' |
||||
- 'spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb' |
||||
- 'spec/controllers/settings/two_factor_authentication/recovery_codes_controller_spec.rb' |
||||
- 'spec/lib/request_spec.rb' |
||||
- 'spec/lib/status_filter_spec.rb' |
||||
- 'spec/models/account_spec.rb' |
||||
- 'spec/models/setting_spec.rb' |
||||
- 'spec/services/activitypub/process_collection_service_spec.rb' |
||||
- 'spec/validators/follow_limit_validator_spec.rb' |
||||
- 'spec/workers/activitypub/delivery_worker_spec.rb' |
||||
- 'spec/workers/web/push_notification_worker_spec.rb' |
||||
|
||||
# Configuration parameters: CountAsOne. |
||||
RSpec/ExampleLength: |
||||
Max: 22 |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyle. |
||||
# SupportedStyles: implicit, each, example |
||||
RSpec/HookArgument: |
||||
Exclude: |
||||
- 'spec/controllers/api/v1/streaming_controller_spec.rb' |
||||
- 'spec/controllers/well_known/webfinger_controller_spec.rb' |
||||
- 'spec/helpers/instance_helper_spec.rb' |
||||
- 'spec/models/user_spec.rb' |
||||
- 'spec/rails_helper.rb' |
||||
- 'spec/serializers/activitypub/note_serializer_spec.rb' |
||||
- 'spec/serializers/activitypub/update_poll_serializer_spec.rb' |
||||
- 'spec/services/import_service_spec.rb' |
||||
|
||||
# Configuration parameters: AssignmentOnly. |
||||
RSpec/InstanceVariable: |
||||
Exclude: |
||||
- 'spec/controllers/api/v1/streaming_controller_spec.rb' |
||||
- 'spec/controllers/auth/confirmations_controller_spec.rb' |
||||
- 'spec/controllers/auth/passwords_controller_spec.rb' |
||||
- 'spec/controllers/auth/sessions_controller_spec.rb' |
||||
- 'spec/controllers/concerns/export_controller_concern_spec.rb' |
||||
- 'spec/controllers/home_controller_spec.rb' |
||||
- 'spec/controllers/settings/two_factor_authentication/webauthn_credentials_controller_spec.rb' |
||||
- 'spec/controllers/statuses_cleanup_controller_spec.rb' |
||||
- 'spec/models/concerns/account_finder_concern_spec.rb' |
||||
- 'spec/models/concerns/account_interactions_spec.rb' |
||||
- 'spec/models/public_feed_spec.rb' |
||||
- 'spec/serializers/activitypub/note_serializer_spec.rb' |
||||
- 'spec/serializers/activitypub/update_poll_serializer_spec.rb' |
||||
- 'spec/services/remove_status_service_spec.rb' |
||||
- 'spec/services/search_service_spec.rb' |
||||
- 'spec/services/unblock_domain_service_spec.rb' |
||||
|
||||
RSpec/LetSetup: |
||||
Exclude: |
||||
- 'spec/controllers/admin/accounts_controller_spec.rb' |
||||
- 'spec/controllers/admin/action_logs_controller_spec.rb' |
||||
- 'spec/controllers/admin/instances_controller_spec.rb' |
||||
- 'spec/controllers/admin/reports/actions_controller_spec.rb' |
||||
- 'spec/controllers/admin/statuses_controller_spec.rb' |
||||
- 'spec/controllers/api/v1/accounts/statuses_controller_spec.rb' |
||||
- 'spec/controllers/api/v1/admin/accounts_controller_spec.rb' |
||||
- 'spec/controllers/api/v1/filters_controller_spec.rb' |
||||
- 'spec/controllers/api/v1/followed_tags_controller_spec.rb' |
||||
- 'spec/controllers/api/v2/admin/accounts_controller_spec.rb' |
||||
- 'spec/controllers/api/v2/filters/keywords_controller_spec.rb' |
||||
- 'spec/controllers/api/v2/filters/statuses_controller_spec.rb' |
||||
- 'spec/controllers/auth/confirmations_controller_spec.rb' |
||||
- 'spec/controllers/auth/passwords_controller_spec.rb' |
||||
- 'spec/controllers/auth/sessions_controller_spec.rb' |
||||
- 'spec/controllers/follower_accounts_controller_spec.rb' |
||||
- 'spec/controllers/following_accounts_controller_spec.rb' |
||||
- 'spec/controllers/oauth/authorized_applications_controller_spec.rb' |
||||
- 'spec/controllers/oauth/tokens_controller_spec.rb' |
||||
- 'spec/controllers/settings/imports_controller_spec.rb' |
||||
- 'spec/lib/activitypub/activity/delete_spec.rb' |
||||
- 'spec/lib/vacuum/applications_vacuum_spec.rb' |
||||
- 'spec/lib/vacuum/preview_cards_vacuum_spec.rb' |
||||
- 'spec/models/account_spec.rb' |
||||
- 'spec/models/account_statuses_cleanup_policy_spec.rb' |
||||
- 'spec/models/canonical_email_block_spec.rb' |
||||
- 'spec/models/status_spec.rb' |
||||
- 'spec/models/user_spec.rb' |
||||
- 'spec/services/account_statuses_cleanup_service_spec.rb' |
||||
- 'spec/services/activitypub/fetch_featured_collection_service_spec.rb' |
||||
- 'spec/services/activitypub/fetch_remote_status_service_spec.rb' |
||||
- 'spec/services/activitypub/process_account_service_spec.rb' |
||||
- 'spec/services/activitypub/process_collection_service_spec.rb' |
||||
- 'spec/services/batched_remove_status_service_spec.rb' |
||||
- 'spec/services/block_domain_service_spec.rb' |
||||
- 'spec/services/bulk_import_service_spec.rb' |
||||
- 'spec/services/delete_account_service_spec.rb' |
||||
- 'spec/services/import_service_spec.rb' |
||||
- 'spec/services/notify_service_spec.rb' |
||||
- 'spec/services/remove_status_service_spec.rb' |
||||
- 'spec/services/report_service_spec.rb' |
||||
- 'spec/services/resolve_account_service_spec.rb' |
||||
- 'spec/services/suspend_account_service_spec.rb' |
||||
- 'spec/services/unallow_domain_service_spec.rb' |
||||
- 'spec/services/unsuspend_account_service_spec.rb' |
||||
- 'spec/workers/scheduler/user_cleanup_scheduler_spec.rb' |
||||
|
||||
RSpec/MessageChain: |
||||
Exclude: |
||||
- 'spec/controllers/api/v1/media_controller_spec.rb' |
||||
- 'spec/models/concerns/remotable_spec.rb' |
||||
- 'spec/models/session_activation_spec.rb' |
||||
- 'spec/models/setting_spec.rb' |
||||
|
||||
# Configuration parameters: EnforcedStyle. |
||||
# SupportedStyles: have_received, receive |
||||
RSpec/MessageSpies: |
||||
Exclude: |
||||
- 'spec/controllers/admin/accounts_controller_spec.rb' |
||||
- 'spec/helpers/admin/account_moderation_notes_helper_spec.rb' |
||||
- 'spec/lib/webfinger_resource_spec.rb' |
||||
- 'spec/models/admin/account_action_spec.rb' |
||||
- 'spec/models/concerns/remotable_spec.rb' |
||||
- 'spec/models/follow_request_spec.rb' |
||||
- 'spec/models/identity_spec.rb' |
||||
- 'spec/models/session_activation_spec.rb' |
||||
- 'spec/models/setting_spec.rb' |
||||
- 'spec/services/activitypub/fetch_replies_service_spec.rb' |
||||
- 'spec/services/activitypub/process_collection_service_spec.rb' |
||||
- 'spec/spec_helper.rb' |
||||
- 'spec/validators/status_length_validator_spec.rb' |
||||
|
||||
RSpec/MultipleExpectations: |
||||
Max: 8 |
||||
|
||||
# Configuration parameters: AllowSubject. |
||||
RSpec/MultipleMemoizedHelpers: |
||||
Max: 21 |
||||
|
||||
# Configuration parameters: AllowedGroups. |
||||
RSpec/NestedGroups: |
||||
Max: 6 |
||||
|
||||
RSpec/PendingWithoutReason: |
||||
Exclude: |
||||
- 'spec/models/account_spec.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
Rails/ApplicationController: |
||||
Exclude: |
||||
- 'app/controllers/health_controller.rb' |
||||
|
||||
# Configuration parameters: Include. |
||||
# Include: db/**/*.rb |
||||
Rails/CreateTableWithTimestamps: |
||||
Exclude: |
||||
- 'db/migrate/20170508230434_create_conversation_mutes.rb' |
||||
- 'db/migrate/20170823162448_create_status_pins.rb' |
||||
- 'db/migrate/20171116161857_create_list_accounts.rb' |
||||
- 'db/migrate/20180929222014_create_account_conversations.rb' |
||||
- 'db/migrate/20181007025445_create_pghero_space_stats.rb' |
||||
- 'db/migrate/20190103124649_create_scheduled_statuses.rb' |
||||
- 'db/migrate/20220824233535_create_status_trends.rb' |
||||
- 'db/migrate/20221006061337_create_preview_card_trends.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: Severity. |
||||
Rails/DuplicateAssociation: |
||||
Exclude: |
||||
- 'app/serializers/activitypub/collection_serializer.rb' |
||||
- 'app/serializers/activitypub/note_serializer.rb' |
||||
|
||||
# Configuration parameters: Include. |
||||
# Include: app/models/**/*.rb |
||||
Rails/HasAndBelongsToMany: |
||||
Exclude: |
||||
- 'app/models/concerns/account_associations.rb' |
||||
- 'app/models/preview_card.rb' |
||||
- 'app/models/status.rb' |
||||
- 'app/models/tag.rb' |
||||
|
||||
# Configuration parameters: Include. |
||||
# Include: app/models/**/*.rb |
||||
Rails/HasManyOrHasOneDependent: |
||||
Exclude: |
||||
- 'app/models/concerns/account_counters.rb' |
||||
- 'app/models/conversation.rb' |
||||
- 'app/models/custom_emoji.rb' |
||||
- 'app/models/custom_emoji_category.rb' |
||||
- 'app/models/domain_block.rb' |
||||
- 'app/models/invite.rb' |
||||
- 'app/models/status.rb' |
||||
- 'app/models/user.rb' |
||||
- 'app/models/web/push_subscription.rb' |
||||
|
||||
Rails/I18nLocaleTexts: |
||||
Exclude: |
||||
- 'lib/tasks/mastodon.rake' |
||||
- 'spec/helpers/flashes_helper_spec.rb' |
||||
|
||||
# Configuration parameters: Include. |
||||
# Include: app/controllers/**/*.rb, app/mailers/**/*.rb |
||||
Rails/LexicallyScopedActionFilter: |
||||
Exclude: |
||||
- 'app/controllers/auth/passwords_controller.rb' |
||||
- 'app/controllers/auth/registrations_controller.rb' |
||||
- 'app/controllers/auth/sessions_controller.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
Rails/NegateInclude: |
||||
Exclude: |
||||
- 'app/controllers/concerns/signature_verification.rb' |
||||
- 'app/helpers/jsonld_helper.rb' |
||||
- 'app/lib/activitypub/activity/create.rb' |
||||
- 'app/lib/activitypub/activity/move.rb' |
||||
- 'app/lib/feed_manager.rb' |
||||
- 'app/lib/link_details_extractor.rb' |
||||
- 'app/models/concerns/attachmentable.rb' |
||||
- 'app/models/concerns/remotable.rb' |
||||
- 'app/models/custom_filter.rb' |
||||
- 'app/services/activitypub/process_status_update_service.rb' |
||||
- 'app/services/fetch_link_card_service.rb' |
||||
- 'app/services/search_service.rb' |
||||
- 'app/workers/web/push_notification_worker.rb' |
||||
- 'lib/paperclip/color_extractor.rb' |
||||
|
||||
Rails/OutputSafety: |
||||
Exclude: |
||||
- 'config/initializers/simple_form.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
# Configuration parameters: Include. |
||||
# Include: **/Rakefile, **/*.rake |
||||
Rails/RakeEnvironment: |
||||
Exclude: |
||||
- 'lib/tasks/auto_annotate_models.rake' |
||||
- 'lib/tasks/db.rake' |
||||
- 'lib/tasks/emojis.rake' |
||||
- 'lib/tasks/mastodon.rake' |
||||
- 'lib/tasks/repo.rake' |
||||
- 'lib/tasks/statistics.rake' |
||||
|
||||
# Configuration parameters: Include. |
||||
# Include: db/**/*.rb |
||||
Rails/ReversibleMigration: |
||||
Exclude: |
||||
- 'db/migrate/20160223164502_make_uris_nullable_in_statuses.rb' |
||||
- 'db/migrate/20161122163057_remove_unneeded_indexes.rb' |
||||
- 'db/migrate/20170205175257_remove_devices.rb' |
||||
- 'db/migrate/20170322143850_change_primary_key_to_bigint_on_statuses.rb' |
||||
- 'db/migrate/20170520145338_change_language_filter_to_opt_out.rb' |
||||
- 'db/migrate/20170609145826_remove_default_language_from_statuses.rb' |
||||
- 'db/migrate/20170711225116_fix_null_booleans.rb' |
||||
- 'db/migrate/20171129172043_add_index_on_stream_entries.rb' |
||||
- 'db/migrate/20171212195226_remove_duplicate_indexes_in_lists.rb' |
||||
- 'db/migrate/20171226094803_more_faster_index_on_notifications.rb' |
||||
- 'db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb' |
||||
- 'db/migrate/20180617162849_remove_unused_indexes.rb' |
||||
- 'db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb' |
||||
|
||||
# Configuration parameters: ForbiddenMethods, AllowedMethods. |
||||
# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all |
||||
Rails/SkipsModelValidations: |
||||
Exclude: |
||||
- 'app/controllers/admin/invites_controller.rb' |
||||
- 'app/controllers/concerns/session_tracking_concern.rb' |
||||
- 'app/models/concerns/account_merging.rb' |
||||
- 'app/models/concerns/expireable.rb' |
||||
- 'app/models/status.rb' |
||||
- 'app/models/trends/links.rb' |
||||
- 'app/models/trends/preview_card_batch.rb' |
||||
- 'app/models/trends/preview_card_provider_batch.rb' |
||||
- 'app/models/trends/status_batch.rb' |
||||
- 'app/models/trends/statuses.rb' |
||||
- 'app/models/trends/tag_batch.rb' |
||||
- 'app/models/trends/tags.rb' |
||||
- 'app/models/user.rb' |
||||
- 'app/services/activitypub/process_status_update_service.rb' |
||||
- 'app/services/approve_appeal_service.rb' |
||||
- 'app/services/block_domain_service.rb' |
||||
- 'app/services/delete_account_service.rb' |
||||
- 'app/services/process_mentions_service.rb' |
||||
- 'app/services/unallow_domain_service.rb' |
||||
- 'app/services/unblock_domain_service.rb' |
||||
- 'app/services/update_status_service.rb' |
||||
- 'app/workers/activitypub/post_upgrade_worker.rb' |
||||
- 'app/workers/move_worker.rb' |
||||
- 'app/workers/scheduler/ip_cleanup_scheduler.rb' |
||||
- 'app/workers/scheduler/scheduled_statuses_scheduler.rb' |
||||
- 'db/migrate/20161203164520_add_from_account_id_to_notifications.rb' |
||||
- 'db/migrate/20170105224407_add_shortcode_to_media_attachments.rb' |
||||
- 'db/migrate/20170209184350_add_reply_to_statuses.rb' |
||||
- 'db/migrate/20170304202101_add_type_to_media_attachments.rb' |
||||
- 'db/migrate/20180528141303_fix_accounts_unique_index.rb' |
||||
- 'db/migrate/20180609104432_migrate_web_push_subscriptions2.rb' |
||||
- 'db/migrate/20181207011115_downcase_custom_emoji_domains.rb' |
||||
- 'db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb' |
||||
- 'db/migrate/20191007013357_update_pt_locales.rb' |
||||
- 'db/migrate/20220316233212_update_kurdish_locales.rb' |
||||
- 'db/post_migrate/20190511152737_remove_suspended_silenced_account_fields.rb' |
||||
- 'db/post_migrate/20200917193528_migrate_notifications_type.rb' |
||||
- 'db/post_migrate/20201017234926_fill_account_suspension_origin.rb' |
||||
- 'db/post_migrate/20220617202502_migrate_roles.rb' |
||||
- 'db/post_migrate/20221101190723_backfill_admin_action_logs.rb' |
||||
- 'db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb' |
||||
- 'lib/mastodon/cli/accounts.rb' |
||||
- 'lib/mastodon/cli/main.rb' |
||||
- 'lib/mastodon/cli/maintenance.rb' |
||||
- 'spec/controllers/api/v1/admin/accounts_controller_spec.rb' |
||||
- 'spec/lib/activitypub/activity/follow_spec.rb' |
||||
- 'spec/services/follow_service_spec.rb' |
||||
- 'spec/services/update_account_service_spec.rb' |
||||
|
||||
# Configuration parameters: Include. |
||||
# Include: db/**/*.rb |
||||
Rails/ThreeStateBooleanColumn: |
||||
Exclude: |
||||
- 'db/migrate/20160325130944_add_admin_to_users.rb' |
||||
- 'db/migrate/20161123093447_add_sensitive_to_statuses.rb' |
||||
- 'db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb' |
||||
- 'db/migrate/20170127165745_add_devise_two_factor_to_users.rb' |
||||
- 'db/migrate/20170209184350_add_reply_to_statuses.rb' |
||||
- 'db/migrate/20170330163835_create_imports.rb' |
||||
- 'db/migrate/20170905165803_add_local_to_statuses.rb' |
||||
- 'db/migrate/20181203021853_add_discoverable_to_accounts.rb' |
||||
- 'db/migrate/20190509164208_add_by_moderator_to_tombstone.rb' |
||||
- 'db/migrate/20190805123746_add_capabilities_to_tags.rb' |
||||
- 'db/migrate/20191212163405_add_hide_collections_to_accounts.rb' |
||||
- 'db/migrate/20200309150742_add_forwarded_to_reports.rb' |
||||
- 'db/migrate/20210609202149_create_login_activities.rb' |
||||
- 'db/migrate/20210621221010_add_skip_sign_in_token_to_users.rb' |
||||
- 'db/migrate/20211031031021_create_preview_card_providers.rb' |
||||
- 'db/migrate/20211115032527_add_trendable_to_preview_cards.rb' |
||||
- 'db/migrate/20220202200743_add_trendable_to_accounts.rb' |
||||
- 'db/migrate/20220202200926_add_trendable_to_statuses.rb' |
||||
- 'db/migrate/20220303000827_add_ordered_media_attachment_ids_to_status_edits.rb' |
||||
|
||||
# Configuration parameters: Include. |
||||
# Include: app/models/**/*.rb |
||||
Rails/UniqueValidationWithoutIndex: |
||||
Exclude: |
||||
- 'app/models/account_alias.rb' |
||||
- 'app/models/custom_filter_status.rb' |
||||
- 'app/models/identity.rb' |
||||
- 'app/models/webauthn_credential.rb' |
||||
|
||||
# Configuration parameters: Include. |
||||
# Include: app/models/**/*.rb |
||||
Rails/UnusedIgnoredColumns: |
||||
Exclude: |
||||
- 'app/models/account.rb' |
||||
- 'app/models/account_stat.rb' |
||||
- 'app/models/admin/action_log.rb' |
||||
- 'app/models/custom_filter.rb' |
||||
- 'app/models/email_domain_block.rb' |
||||
- 'app/models/report.rb' |
||||
- 'app/models/status_edit.rb' |
||||
- 'app/models/user.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
# Configuration parameters: EnforcedStyle. |
||||
# SupportedStyles: exists, where |
||||
Rails/WhereExists: |
||||
Exclude: |
||||
- 'app/controllers/activitypub/inboxes_controller.rb' |
||||
- 'app/controllers/admin/email_domain_blocks_controller.rb' |
||||
- 'app/controllers/auth/registrations_controller.rb' |
||||
- 'app/lib/activitypub/activity/create.rb' |
||||
- 'app/lib/delivery_failure_tracker.rb' |
||||
- 'app/lib/feed_manager.rb' |
||||
- 'app/lib/status_cache_hydrator.rb' |
||||
- 'app/lib/suspicious_sign_in_detector.rb' |
||||
- 'app/models/concerns/account_interactions.rb' |
||||
- 'app/models/featured_tag.rb' |
||||
- 'app/models/poll.rb' |
||||
- 'app/models/session_activation.rb' |
||||
- 'app/models/status.rb' |
||||
- 'app/models/user.rb' |
||||
- 'app/policies/status_policy.rb' |
||||
- 'app/serializers/rest/announcement_serializer.rb' |
||||
- 'app/serializers/rest/tag_serializer.rb' |
||||
- 'app/services/activitypub/fetch_remote_status_service.rb' |
||||
- 'app/services/app_sign_up_service.rb' |
||||
- 'app/services/vote_service.rb' |
||||
- 'app/validators/reaction_validator.rb' |
||||
- 'app/validators/vote_validator.rb' |
||||
- 'app/workers/move_worker.rb' |
||||
- 'db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb' |
||||
- 'lib/tasks/tests.rake' |
||||
- 'spec/models/account_spec.rb' |
||||
- 'spec/services/activitypub/process_collection_service_spec.rb' |
||||
- 'spec/services/purge_domain_service_spec.rb' |
||||
- 'spec/services/unallow_domain_service_spec.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: AllowOnConstant, AllowOnSelfClass. |
||||
Style/CaseEquality: |
||||
Exclude: |
||||
- 'config/initializers/trusted_proxies.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: AllowedMethods, AllowedPatterns. |
||||
# AllowedMethods: ==, equal?, eql? |
||||
Style/ClassEqualityComparison: |
||||
Exclude: |
||||
- 'app/helpers/jsonld_helper.rb' |
||||
- 'app/serializers/activitypub/outbox_serializer.rb' |
||||
|
||||
Style/ClassVars: |
||||
Exclude: |
||||
- 'config/initializers/devise.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
Style/CombinableLoops: |
||||
Exclude: |
||||
- 'app/models/form/custom_emoji_batch.rb' |
||||
- 'app/models/form/ip_block_batch.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: AllowedVars. |
||||
Style/FetchEnvVar: |
||||
Exclude: |
||||
- 'app/lib/redis_configuration.rb' |
||||
- 'app/lib/translation_service.rb' |
||||
- 'config/environments/development.rb' |
||||
- 'config/environments/production.rb' |
||||
- 'config/initializers/2_limited_federation_mode.rb' |
||||
- 'config/initializers/blacklists.rb' |
||||
- 'config/initializers/cache_buster.rb' |
||||
- 'config/initializers/content_security_policy.rb' |
||||
- 'config/initializers/devise.rb' |
||||
- 'config/initializers/omniauth.rb' |
||||
- 'config/initializers/paperclip.rb' |
||||
- 'config/initializers/vapid.rb' |
||||
- 'lib/mastodon/premailer_webpack_strategy.rb' |
||||
- 'lib/mastodon/redis_config.rb' |
||||
- 'lib/tasks/repo.rake' |
||||
- 'spec/features/profile_spec.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns. |
||||
# SupportedStyles: annotated, template, unannotated |
||||
# AllowedMethods: redirect |
||||
Style/FormatStringToken: |
||||
Exclude: |
||||
- 'app/models/privacy_policy.rb' |
||||
- 'config/initializers/devise.rb' |
||||
- 'lib/paperclip/color_extractor.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
Style/GlobalStdStream: |
||||
Exclude: |
||||
- 'config/boot.rb' |
||||
- 'config/environments/development.rb' |
||||
- 'config/environments/production.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. |
||||
Style/GuardClause: |
||||
Exclude: |
||||
- 'app/controllers/admin/confirmations_controller.rb' |
||||
- 'app/controllers/auth/confirmations_controller.rb' |
||||
- 'app/controllers/auth/passwords_controller.rb' |
||||
- 'app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb' |
||||
- 'app/lib/activitypub/activity/block.rb' |
||||
- 'app/lib/request.rb' |
||||
- 'app/lib/request_pool.rb' |
||||
- 'app/lib/webfinger.rb' |
||||
- 'app/lib/webfinger_resource.rb' |
||||
- 'app/models/concerns/account_counters.rb' |
||||
- 'app/models/concerns/ldap_authenticable.rb' |
||||
- 'app/models/tag.rb' |
||||
- 'app/models/user.rb' |
||||
- 'app/services/fan_out_on_write_service.rb' |
||||
- 'app/services/post_status_service.rb' |
||||
- 'app/services/process_hashtags_service.rb' |
||||
- 'app/workers/move_worker.rb' |
||||
- 'app/workers/redownload_avatar_worker.rb' |
||||
- 'app/workers/redownload_header_worker.rb' |
||||
- 'app/workers/redownload_media_worker.rb' |
||||
- 'app/workers/remote_account_refresh_worker.rb' |
||||
- 'config/initializers/devise.rb' |
||||
- 'db/migrate/20170901141119_truncate_preview_cards.rb' |
||||
- 'db/post_migrate/20220704024901_migrate_settings_to_user_roles.rb' |
||||
- 'lib/devise/two_factor_ldap_authenticatable.rb' |
||||
- 'lib/devise/two_factor_pam_authenticatable.rb' |
||||
- 'lib/mastodon/cli/accounts.rb' |
||||
- 'lib/mastodon/cli/maintenance.rb' |
||||
- 'lib/mastodon/cli/media.rb' |
||||
- 'lib/paperclip/attachment_extensions.rb' |
||||
- 'lib/tasks/repo.rake' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyle. |
||||
# SupportedStyles: braces, no_braces |
||||
Style/HashAsLastArrayItem: |
||||
Exclude: |
||||
- 'app/controllers/admin/statuses_controller.rb' |
||||
- 'app/controllers/api/v1/statuses_controller.rb' |
||||
- 'app/models/concerns/account_counters.rb' |
||||
- 'app/models/concerns/status_threading_concern.rb' |
||||
- 'app/models/status.rb' |
||||
- 'app/services/batched_remove_status_service.rb' |
||||
- 'app/services/notify_service.rb' |
||||
- 'db/migrate/20181024224956_migrate_account_conversations.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
Style/HashTransformValues: |
||||
Exclude: |
||||
- 'app/serializers/rest/web_push_subscription_serializer.rb' |
||||
- 'app/services/import_service.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
Style/IfUnlessModifier: |
||||
Exclude: |
||||
- 'config/environments/production.rb' |
||||
- 'config/initializers/devise.rb' |
||||
- 'config/initializers/ffmpeg.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
# Configuration parameters: InverseMethods, InverseBlocks. |
||||
Style/InverseMethods: |
||||
Exclude: |
||||
- 'app/models/custom_filter.rb' |
||||
- 'app/services/update_account_service.rb' |
||||
- 'spec/controllers/activitypub/replies_controller_spec.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyle. |
||||
# SupportedStyles: line_count_dependent, lambda, literal |
||||
Style/Lambda: |
||||
Exclude: |
||||
- 'config/initializers/simple_form.rb' |
||||
- 'config/routes.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
Style/MapToHash: |
||||
Exclude: |
||||
- 'app/models/status.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
# Configuration parameters: EnforcedStyle. |
||||
# SupportedStyles: literals, strict |
||||
Style/MutableConstant: |
||||
Exclude: |
||||
- 'app/models/tag.rb' |
||||
- 'app/services/delete_account_service.rb' |
||||
- 'lib/mastodon/migration_warning.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
Style/NilLambda: |
||||
Exclude: |
||||
- 'config/initializers/paperclip.rb' |
||||
|
||||
# Configuration parameters: AllowedMethods. |
||||
# AllowedMethods: respond_to_missing? |
||||
Style/OptionalBooleanParameter: |
||||
Exclude: |
||||
- 'app/helpers/admin/account_moderation_notes_helper.rb' |
||||
- 'app/helpers/jsonld_helper.rb' |
||||
- 'app/lib/admin/system_check/message.rb' |
||||
- 'app/lib/request.rb' |
||||
- 'app/lib/webfinger.rb' |
||||
- 'app/services/block_domain_service.rb' |
||||
- 'app/services/fetch_resource_service.rb' |
||||
- 'app/workers/domain_block_worker.rb' |
||||
- 'app/workers/unfollow_follow_worker.rb' |
||||
- 'lib/mastodon/redis_config.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: PreferredDelimiters. |
||||
Style/PercentLiteralDelimiters: |
||||
Exclude: |
||||
- 'config/deploy.rb' |
||||
- 'config/initializers/doorkeeper.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
# Configuration parameters: EnforcedStyle. |
||||
# SupportedStyles: short, verbose |
||||
Style/PreferredHashMethods: |
||||
Exclude: |
||||
- 'config/initializers/paperclip.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
Style/RedundantConstantBase: |
||||
Exclude: |
||||
- 'config/environments/production.rb' |
||||
- 'config/initializers/sidekiq.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
# Configuration parameters: SafeForConstants. |
||||
Style/RedundantFetchBlock: |
||||
Exclude: |
||||
- 'config/initializers/1_hosts.rb' |
||||
- 'config/initializers/chewy.rb' |
||||
- 'config/initializers/devise.rb' |
||||
- 'config/initializers/paperclip.rb' |
||||
- 'config/puma.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. |
||||
# AllowedMethods: present?, blank?, presence, try, try! |
||||
Style/SafeNavigation: |
||||
Exclude: |
||||
- 'app/models/concerns/account_finder_concern.rb' |
||||
- 'app/models/status.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyle. |
||||
# SupportedStyles: only_raise, only_fail, semantic |
||||
Style/SignalException: |
||||
Exclude: |
||||
- 'lib/devise/two_factor_ldap_authenticatable.rb' |
||||
- 'lib/devise/two_factor_pam_authenticatable.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
Style/SingleArgumentDig: |
||||
Exclude: |
||||
- 'lib/webpacker/manifest_extensions.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyle. |
||||
# SupportedStyles: require_parentheses, require_no_parentheses |
||||
Style/StabbyLambdaParentheses: |
||||
Exclude: |
||||
- 'config/environments/production.rb' |
||||
- 'config/initializers/content_security_policy.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
Style/StderrPuts: |
||||
Exclude: |
||||
- 'config/boot.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
# Configuration parameters: Mode. |
||||
Style/StringConcatenation: |
||||
Exclude: |
||||
- 'config/initializers/paperclip.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. |
||||
# SupportedStyles: single_quotes, double_quotes |
||||
Style/StringLiterals: |
||||
Exclude: |
||||
- 'config/environments/production.rb' |
||||
- 'config/initializers/backtrace_silencers.rb' |
||||
- 'config/initializers/http_client_proxy.rb' |
||||
- 'config/initializers/rack_attack.rb' |
||||
- 'config/initializers/webauthn.rb' |
||||
- 'config/routes.rb' |
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all). |
||||
# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments. |
||||
# AllowedMethods: define_method, mail, respond_to |
||||
Style/SymbolProc: |
||||
Exclude: |
||||
- 'config/initializers/omniauth.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyle, AllowSafeAssignment. |
||||
# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex |
||||
Style/TernaryParentheses: |
||||
Exclude: |
||||
- 'config/environments/development.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyleForMultiline. |
||||
# SupportedStylesForMultiline: comma, consistent_comma, no_comma |
||||
Style/TrailingCommaInArguments: |
||||
Exclude: |
||||
- 'config/initializers/paperclip.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyleForMultiline. |
||||
# SupportedStylesForMultiline: comma, consistent_comma, no_comma |
||||
Style/TrailingCommaInHashLiteral: |
||||
Exclude: |
||||
- 'config/environments/production.rb' |
||||
- 'config/environments/test.rb' |
||||
|
||||
# This cop supports safe autocorrection (--autocorrect). |
||||
# Configuration parameters: EnforcedStyle, MinSize, WordRegex. |
||||
# SupportedStyles: percent, brackets |
||||
Style/WordArray: |
||||
Exclude: |
||||
- 'app/helpers/languages_helper.rb' |
||||
- 'config/initializers/cors.rb' |
||||
- 'spec/controllers/settings/imports_controller_spec.rb' |
||||
- 'spec/models/form/import_spec.rb' |
||||
@ -1,4 +1,5 @@
|
||||
ffmpeg |
||||
libopenblas0-pthread |
||||
libpq-dev |
||||
libxdamage1 |
||||
libxfixes3 |
||||
|
||||
@ -1,6 +1,8 @@
|
||||
# frozen_string_literal: true |
||||
|
||||
# Add your own tasks in files placed in lib/tasks ending in .rake, |
||||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. |
||||
|
||||
require File.expand_path('../config/application', __FILE__) |
||||
require File.expand_path('config/application', __dir__) |
||||
|
||||
Rails.application.load_tasks |
||||
|
||||
@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true |
||||
|
||||
class InstancesIndex < Chewy::Index |
||||
settings index: { refresh_interval: '30s' } |
||||
|
||||
index_scope ::Instance.searchable |
||||
|
||||
root date_detection: false do |
||||
field :domain, type: 'text', index_prefixes: { min_chars: 1 } |
||||
field :accounts_count, type: 'long' |
||||
end |
||||
end |
||||
@ -0,0 +1,72 @@
|
||||
# frozen_string_literal: true |
||||
|
||||
class Api::V1::Admin::Trends::Links::PreviewCardProvidersController < Api::BaseController |
||||
include Authorization |
||||
|
||||
LIMIT = 100 |
||||
|
||||
before_action -> { authorize_if_got_token! :'admin:read' }, only: :index |
||||
before_action -> { authorize_if_got_token! :'admin:write' }, except: :index |
||||
before_action :set_providers, only: :index |
||||
|
||||
after_action :verify_authorized |
||||
after_action :insert_pagination_headers, only: :index |
||||
|
||||
PAGINATION_PARAMS = %i(limit).freeze |
||||
|
||||
def index |
||||
authorize :preview_card_provider, :index? |
||||
|
||||
render json: @providers, each_serializer: REST::Admin::Trends::Links::PreviewCardProviderSerializer |
||||
end |
||||
|
||||
def approve |
||||
authorize :preview_card_provider, :review? |
||||
|
||||
provider = PreviewCardProvider.find(params[:id]) |
||||
provider.update(trendable: true, reviewed_at: Time.now.utc) |
||||
render json: provider, serializer: REST::Admin::Trends::Links::PreviewCardProviderSerializer |
||||
end |
||||
|
||||
def reject |
||||
authorize :preview_card_provider, :review? |
||||
|
||||
provider = PreviewCardProvider.find(params[:id]) |
||||
provider.update(trendable: false, reviewed_at: Time.now.utc) |
||||
render json: provider, serializer: REST::Admin::Trends::Links::PreviewCardProviderSerializer |
||||
end |
||||
|
||||
private |
||||
|
||||
def set_providers |
||||
@providers = PreviewCardProvider.all.to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id)) |
||||
end |
||||
|
||||
def insert_pagination_headers |
||||
set_pagination_headers(next_path, prev_path) |
||||
end |
||||
|
||||
def next_path |
||||
api_v1_admin_trends_links_preview_card_providers_url(pagination_params(max_id: pagination_max_id)) if records_continue? |
||||
end |
||||
|
||||
def prev_path |
||||
api_v1_admin_trends_links_preview_card_providers_url(pagination_params(min_id: pagination_since_id)) unless @providers.empty? |
||||
end |
||||
|
||||
def pagination_max_id |
||||
@providers.last.id |
||||
end |
||||
|
||||
def pagination_since_id |
||||
@providers.first.id |
||||
end |
||||
|
||||
def records_continue? |
||||
@providers.size == limit_param(LIMIT) |
||||
end |
||||
|
||||
def pagination_params(core_params) |
||||
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params) |
||||
end |
||||
end |
||||
@ -1,10 +1,10 @@
|
||||
# frozen_string_literal: true |
||||
|
||||
class Api::V1::CustomEmojisController < Api::BaseController |
||||
skip_before_action :set_cache_headers |
||||
vary_by '', unless: :disallow_unauthenticated_api_access? |
||||
|
||||
def index |
||||
expires_in 3.minutes, public: true |
||||
cache_even_if_authenticated! unless disallow_unauthenticated_api_access? |
||||
render_with_cache(each_serializer: REST::CustomEmojiSerializer) { CustomEmoji.listed.includes(:category) } |
||||
end |
||||
end |
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue