Skip to content

Commit

Permalink
Merge pull request #2246 from ClearlyClaire/glitch-soc/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream changes
  • Loading branch information
ClearlyClaire authored Jun 11, 2023
2 parents d907e79 + 20718a8 commit af97a6a
Show file tree
Hide file tree
Showing 650 changed files with 5,956 additions and 9,223 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ module.exports = {
{ property: 'substring', message: 'Use .slice instead of .substring.' },
{ property: 'substr', message: 'Use .slice instead of .substr.' },
],
'no-restricted-syntax': [
'error',
{
// eslint-disable-next-line no-restricted-syntax
selector: 'Literal[value=/•/], JSXText[value=/•/]',
// eslint-disable-next-line no-restricted-syntax
message: "Use '·' (middle dot) instead of '•' (bullet)",
},
],
'no-self-assign': 'off',
'no-unused-expressions': 'error',
'no-unused-vars': 'off',
Expand Down Expand Up @@ -293,6 +302,7 @@ module.exports = {
'.*rc.js',
'ide-helper.js',
'config/webpack/**/*',
'config/formatjs-formatter.js',
],

env: {
Expand Down
114 changes: 114 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
$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,
// so for example grouping rules needs to be at the bottom
packageRules: [
{
// Ignore major version bumps for these node packages
matchManagers: ['npm'],
matchPackageNames: [
'@rails/ujs', // Needs to match the major Rails version
'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: [
'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
'fog-openstack', // TODO: was ignored in https://github.com/mastodon/mastodon/pull/13964

// Needs major Rails version bump
'rack',
'rails',
'rails-i18n',
],
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'],
excludePackageNames: [
'typescript', // Typescript has many changes in minor versions, needs to be checked every time
],
groupName: 'devDependencies (non-major)',
extends: ['schedule:weekly'],
},
{
// Update @types/* packages every week, with one grouped PR
matchPackagePrefixes: '@types/',
matchUpdateTypes: ['patch', 'minor'],
groupName: 'DefinitelyTyped types (non-major)',
extends: ['schedule:weekly'],
addLabels: ['typescript'],
},
// 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'] },
],
}
3 changes: 1 addition & 2 deletions .github/workflows/check-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ jobs:

- name: Check for missing strings in English JSON
run: |
yarn build:development
yarn manage:translations en
yarn i18n:extract --throws
git diff --exit-code
- name: Check locale file normalization
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint-css.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- 'package.json'
- 'yarn.lock'
Expand Down Expand Up @@ -48,4 +49,4 @@ jobs:
- run: echo "::add-matcher::.github/stylelint-matcher.json"

- name: Stylelint
run: yarn test:lint:sass
run: yarn lint:sass
1 change: 1 addition & 0 deletions .github/workflows/lint-haml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- '.github/workflows/haml-lint-problem-matcher.json'
- '.github/workflows/lint-haml.yml'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- 'package.json'
- 'yarn.lock'
Expand Down Expand Up @@ -48,7 +49,7 @@ jobs:
run: yarn --frozen-lockfile

- name: ESLint
run: yarn test:lint:js --max-warnings 0
run: yarn lint:js --max-warnings 0

- name: Typecheck
run: yarn test:typecheck
run: yarn typecheck
3 changes: 2 additions & 1 deletion .github/workflows/lint-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- 'package.json'
- 'yarn.lock'
Expand Down Expand Up @@ -40,4 +41,4 @@ jobs:
run: yarn --frozen-lockfile

- name: Prettier
run: yarn prettier --check "**/*.json"
run: yarn lint:json
6 changes: 5 additions & 1 deletion .github/workflows/lint-md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- '.github/workflows/lint-md.yml'
- '.nvmrc'
- '.prettier*'
- '**/*.md'
- '!AUTHORS.md'
Expand All @@ -14,6 +16,7 @@ on:
pull_request:
paths:
- '.github/workflows/lint-md.yml'
- '.nvmrc'
- '.prettier*'
- '**/*.md'
- '!AUTHORS.md'
Expand All @@ -32,9 +35,10 @@ jobs:
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 prettier --check "**/*.md"
run: yarn lint:md
1 change: 1 addition & 0 deletions .github/workflows/lint-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- 'Gemfile*'
- '.rubocop*.yml'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint-yml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- 'package.json'
- 'yarn.lock'
Expand Down Expand Up @@ -42,4 +43,4 @@ jobs:
run: yarn --frozen-lockfile

- name: Prettier
run: yarn prettier --check "**/*.{yml,yaml}"
run: yarn lint:yml
2 changes: 2 additions & 0 deletions .github/workflows/rebase-needed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
- 'l10n_main'
pull_request_target:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
- 'l10n_main'
types: [synchronize]

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- 'package.json'
- 'yarn.lock'
Expand Down Expand Up @@ -44,4 +45,4 @@ jobs:
run: yarn --frozen-lockfile

- name: Jest testing
run: yarn test:jest --reporters github-actions summary
run: yarn jest --reporters github-actions summary
1 change: 1 addition & 0 deletions .github/workflows/test-migrations-one-step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
pull_request:

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-migrations-two-step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
pull_request:

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
pull_request:

env:
Expand Down
5 changes: 5 additions & 0 deletions .haml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ exclude:
- 'vendor/**/*'
- lib/templates/haml/scaffold/_form.html.haml

require:
- ./lib/linter/haml_middle_dot.rb

linters:
AltText:
enabled: true
MiddleDot:
enabled: true
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ docker-compose.override.yml
/app/javascript/mastodon/features/emoji/emoji_map.json

# Ignore locale files
/app/javascript/mastodon/locales
/app/javascript/mastodon/locales/*.json
/config/locales

# Ignore vendored CSS reset
Expand Down
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require:
- rubocop-rspec
- rubocop-performance
- rubocop-capybara
- ./lib/linter/rubocop_middle_dot

AllCops:
TargetRubyVersion: 3.0 # Set to minimum supported version of CI
Expand Down Expand Up @@ -205,3 +206,6 @@ Style/TrailingCommaInArrayLiteral:
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingcommainhashliteral
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: 'comma'

Style/MiddleDot:
Enabled: true
Loading

0 comments on commit af97a6a

Please sign in to comment.