Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Sync all pre-commit configs from this repo (#334)

Dhruv Bhanushali083f196cf10c
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 000000000..e69de29bb
diff --git a/.flake8 b/.flake8
deleted file mode 100644
index c7c21c63c..000000000
--- a/.flake8
+++ /dev/null
@@ -1,6 +0,0 @@
-[flake8]
-# match black formatter's behavior
-# https://www.flake8rules.com/rules/E203.html
-# https://www.flake8rules.com/rules/W503.html
-ignore = E203, W503
-max-line-length = 88
diff --git a/.github/sync.yml b/.github/sync.yml
index 7e12d887f..99418c037 100644
--- a/.github/sync.yml
+++ b/.github/sync.yml
@@ -42,8 +42,34 @@ group:
dest: .github/PULL_REQUEST_TEMPLATE.md
# Unified lint rules
- repos: |
+ WordPress/openverse
WordPress/openverse-catalog
WordPress/openverse-api
files:
- - source: .pre-commit-config.yaml
+ - source: prettier.config.js.jinja
+ dest: prettier.config.js
+ template: true
+ - repos: |
+ WordPress/openverse
+ files:
+ - source: .pre-commit-config.local.yaml.jinja
+ dest: .pre-commit-config.yaml
+ template: true
+ - repos: |
+ WordPress/openverse-catalog
+ WordPress/openverse-api
+ files:
+ - source: .pre-commit-config.yaml.jinja
+ dest: .pre-commit-config.yaml
+ template:
+ contains_js_code: false
+ - repos: |
+ WordPress/openverse-frontend
+ files:
+ - source: .pre-commit-config.frontend.yaml.jinja
dest: .pre-commit-config.yaml
+ template:
+ contains_python_code: false
+ - source: prettier.config.frontend.js.jinja
+ dest: prettier.config.js
+ template: true
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index c32af629c..eb6c61868 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -21,11 +21,26 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
+ - name: Setup just
+ uses: extractions/setup-just@v1
+
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
+ - name: Setup pnpm
+ uses: pnpm/[email protected]
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16
+ cache: pnpm
+ cache-dependency-path: |
+ pnpm-lock.yaml
+ .npmrc
+
- name: Cache pre-commit envs
uses: actions/cache@v3
with:
@@ -34,5 +49,8 @@ jobs:
- name: Run pre-commit to lint files
run: |
- pip install pre-commit
- pre-commit run --all-files
+ pip install -U pip
+ pip install pipenv
+ just install
+ just precommit
+ just lint
diff --git a/.pre-commit-config.frontend.yaml.jinja b/.pre-commit-config.frontend.yaml.jinja
new file mode 100644
index 000000000..da82829f4
--- /dev/null
+++ b/.pre-commit-config.frontend.yaml.jinja
@@ -0,0 +1,72 @@
+{% set eslint_files = '\\.(js|ts|vue)$' %}
+{% set eslint_exclude = '^nuxt-template-overrides/.*$' %}
+
+{% extends '.pre-commit-config.yaml.jinja' %}
+
+{% block note %}
+{{ super() }}
+# - https://github.com/WordPress/openverse/blob/main/.pre-commit-config.frontend.yaml.jinja
+{%- endblock %}
+
+{#=======================================
+Repo blocks must be indented by 2 spaces.
+=======================================#}
+
+{% block repos_top %}
+ - repo: local # More local hooks are defined at the bottom.
+ hooks:
+ - id: i18n
+ name: i18n
+ # Check if the i18n files have been downloaded by checking if the Arabic translation exists
+ # Download the i18n files if they do not exist
+ entry: bash -c 'if [ ! -f "$(dirname "$dir")"/src/locales/ar.json ]; then pnpm i18n; fi'
+ language: system
+ pass_filenames: false
+{# This comment adds a blank line. #}
+{% endblock %}
+
+{% block repos_bottom %}
+{# This comment adds a blank line. #}
+ - repo: local # More local hooks are defined at the top.
+ hooks:
+ - id: types
+ name: types
+ entry: bash -c 'pnpm types'
+ language: system
+ pass_filenames: false
+
+ - id: test:unit
+ name: test:unit
+ entry: bash -c 'pnpm test:unit'
+ language: system
+ pass_filenames: false
+ stages:
+ - push
+{% endblock %}
+
+{#=========================================
+Dependencies must be indented by 10 spaces.
+=========================================#}
+
+{% block eslint_dependencies %}
+{{ super() }}
+ - '@babel/[email protected]'
+ - '@intlify/[email protected]'
+ - '@nuxtjs/[email protected]'
+ - '@typescript-eslint/[email protected]'
+ - '@typescript-eslint/[email protected]'
+{%- endblock %}
+
+{% block prettier_dependencies %}
+{{ super() }}
+{%- endblock %}
diff --git a/.pre-commit-config.local.yaml.jinja b/.pre-commit-config.local.yaml.jinja
new file mode 100644
index 000000000..39287cb69
--- /dev/null
+++ b/.pre-commit-config.local.yaml.jinja
@@ -0,0 +1,23 @@
+{% extends '.pre-commit-config.yaml.jinja' %}
+
+{% block note %}
+{{ super() }}
+# - https://github.com/WordPress/openverse/blob/main/.pre-commit-config.local.yaml.jinja
+{%- endblock %}
+
+{% block repos_bottom %}
+{# This comment adds a blank line. #}
+ - repo: local
+ hooks:
+ - id: render-precommit
+ name: render-precommit
+ entry: bash -c 'just render-precommit'
+ language: system
+ pass_filenames: false
+
+ - id: render-prettier
+ name: render-prettier
+ entry: bash -c 'just render-prettier'
+ language: system
+ pass_filenames: false
+{% endblock %}
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index e8b6d14f8..373c849d8 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,3 +1,8 @@
+# This file is being synced from WordPress/openverse. Any changes made to it
+# here will be overwritten. Please make any necessary edits to these files:
+# - https://github.com/WordPress/openverse/blob/main/.pre-commit-config.yaml.jinja
+# - https://github.com/WordPress/openverse/blob/main/.pre-commit-config.local.yaml.jinja
+
exclude: Pipfile\.lock|migrations|\.idea|node_modules|archive
repos:
@@ -6,22 +11,25 @@ repos:
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- - id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
+ exclude: tsconfig.json # contains comments
- id: check-case-conflict
- id: check-toml
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: end-of-file-fixer
+ exclude: test/tapes/.+\.json5
- id: check-symlinks
- id: mixed-line-ending
- id: fix-encoding-pragma
args:
- --remove
+ - id: check-docstring-first
- id: requirements-txt-fixer
+ # Use the `.isort.cfg` file to configure additional project-specific requirements.
- repo: https://github.com/PyCQA/isort
rev: 5.9.1
hooks:
@@ -29,13 +37,8 @@ repos:
files: \.py$
exclude: ^build/.*$|^.tox/.*$|^venv/.*$
args:
+ - --profile=black
- --lines-after-imports=2
- - --multi-line=3
- - --trailing-comma
- - --force-grid-wrap=0
- - --use-parentheses
- - --ensure-newline-before-comments
- - --line-length=88
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
@@ -44,10 +47,14 @@ repos:
args:
- --py310-plus
+ # Use the `.flake8` file to configure additional project-specific requirements.
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
+ args:
+ - --extend-ignore=E203,W503
+ - --max-line-length=88
- repo: https://github.com/ambv/black
rev: 22.3.0
@@ -57,21 +64,43 @@ repos:
- --safe
- repo: https://github.com/pre-commit/mirrors-eslint
- rev: v8.3.0
+ rev: v8.15.0
hooks:
- id: eslint
files: ^js/.*$
+ 'types': [file] # ESLint only accepts [javascript] by default.
+ args:
+ - --ignore-path=.gitignore
+ - --ignore-path=.eslintignore
+ - --max-warnings=0
additional_dependencies:
+ # Use the `.prettierignore` and `.prettier.config.js` files to configure project-specific requirements.
- repo: https://github.com/pre-commit/mirrors-prettier
- rev: v2.5.0
+ rev: v2.6.0
hooks:
- id: prettier
- exclude: .*\.md$
+ exclude: \.md$ # TODO: https://github.com/WordPress/openverse/issues/333
+ additional_dependencies:
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.8.0
hooks:
- id: shellcheck
+
+ - repo: local
+ hooks:
+ - id: render-precommit
+ name: render-precommit
+ entry: bash -c 'just render-precommit'
+ language: system
+ pass_filenames: false
+
+ - id: render-prettier
+ name: render-prettier
+ entry: bash -c 'just render-prettier'
+ language: system
+ pass_filenames: false
diff --git a/.pre-commit-config.yaml.jinja b/.pre-commit-config.yaml.jinja
new file mode 100644
index 000000000..8fafdbaa2
--- /dev/null
+++ b/.pre-commit-config.yaml.jinja
@@ -0,0 +1,113 @@
+{% block note %}
+# This file is being synced from WordPress/openverse. Any changes made to it
+# here will be overwritten. Please make any necessary edits to these files:
+# - https://github.com/WordPress/openverse/blob/main/.pre-commit-config.yaml.jinja
+{%- endblock %}
+
+{# This comment adds a blank line. #}
+exclude: Pipfile\.lock|migrations|\.idea|node_modules|archive
+
+repos:
+ {% block repos_top %}
+ {% endblock %}
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.0.1
+ hooks:
+ - id: trailing-whitespace
+ args: [--markdown-linebreak-ext=md]
+ - id: check-executables-have-shebangs
+ - id: check-json
+ exclude: tsconfig.json # contains comments
+ - id: check-case-conflict
+ - id: check-toml
+ - id: check-merge-conflict
+ - id: check-xml
+ - id: check-yaml
+ - id: end-of-file-fixer
+ exclude: test/tapes/.+\.json5
+ - id: check-symlinks
+ - id: mixed-line-ending
+ - id: fix-encoding-pragma
+ args:
+ - --remove
+ {% if contains_python_code | default(true) %}
+ - id: check-docstring-first
+ - id: requirements-txt-fixer
+ {% endif %}
+
+ {% if contains_python_code | default(true) %}
+ # Use the `.isort.cfg` file to configure additional project-specific requirements.
+ - repo: https://github.com/PyCQA/isort
+ rev: 5.9.1
+ hooks:
+ - id: isort
+ files: \.py$
+ exclude: ^build/.*$|^.tox/.*$|^venv/.*$
+ args:
+ - --profile=black
+ - --lines-after-imports=2
+
+ - repo: https://github.com/asottile/pyupgrade
+ rev: v3.2.2
+ hooks:
+ - id: pyupgrade
+ args:
+ - --py310-plus
+
+ # Use the `.flake8` file to configure additional project-specific requirements.
+ - repo: https://github.com/PyCQA/flake8
+ rev: 3.9.2
+ hooks:
+ - id: flake8
+ args:
+ - --extend-ignore=E203,W503
+ - --max-line-length=88
+
+ - repo: https://github.com/ambv/black
+ rev: 22.3.0
+ hooks:
+ - id: black
+ args:
+ - --safe
+
+ {% endif %}
+ {% if contains_js_code | default(true) %}
+ - repo: https://github.com/pre-commit/mirrors-eslint
+ rev: v8.15.0
+ hooks:
+ - id: eslint
+ files: {{ eslint_files | default('^js/.*$') }}
+ {% if eslint_exclude %}
+ exclude: {{ eslint_exclude }} # ESLint raises warnings for ignored files.
+ {% endif %}
+ 'types': [file] # ESLint only accepts [javascript] by default.
+ args:
+ - --ignore-path=.gitignore
+ - --ignore-path=.eslintignore
+ - --max-warnings=0
+ additional_dependencies:
+ {% block eslint_dependencies %}
+ {%- endblock %}
+
+{# This comment adds a blank line. #}
+ {% endif %}
+ # Use the `.prettierignore` and `.prettier.config.js` files to configure project-specific requirements.
+ - repo: https://github.com/pre-commit/mirrors-prettier
+ rev: v2.6.0
+ hooks:
+ - id: prettier
+ exclude: \.md$ # TODO: https://github.com/WordPress/openverse/issues/333
+ additional_dependencies:
+ {% block prettier_dependencies %}
+ {%- endblock %}
+
+{# This comment adds a blank line. #}
+ - repo: https://github.com/koalaman/shellcheck-precommit
+ rev: v0.8.0
+ hooks:
+ - id: shellcheck
+ {% block repos_bottom %}
+ {% endblock %}
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 000000000..bd5535a60
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1 @@
+pnpm-lock.yaml
diff --git a/automations/js/src/render-jinja.js b/automations/js/src/render-jinja.js
new file mode 100644
index 000000000..23bd2f38c
--- /dev/null
+++ b/automations/js/src/render-jinja.js
@@ -0,0 +1,22 @@
+const fs = require('fs')
+const path = require('path')
+
+const nunjucks = require('nunjucks')
+
+const rootDir = path.join(__dirname, '..', '..', '..')
+nunjucks.configure(rootDir, {
+ trimBlocks: true,
+ lstripBlocks: true,
+ autoescape: true,
+})
+
+function render(inFileName, outFile, context = {}) {
+ const inFilePath = path.join(rootDir, inFileName)
+ const outFilePath = path.join(rootDir, outFile)
+ fs.writeFileSync(
+ outFilePath,
+ nunjucks.renderString(fs.readFileSync(inFilePath).toString(), context)
+ )
+}
+
+render(process.argv[2], process.argv[3], JSON.parse(process.argv[4]))
diff --git a/justfile b/justfile
index 3575c5371..ddeaccf0a 100644
--- a/justfile
+++ b/justfile
@@ -36,3 +36,15 @@ _py-install:
# Install dependencies for JavaScript
_js-install:
cd automations/js && pnpm install
+
+# Run `render-jinja.js` with given input file, output file and context
+render in_file out_file ctx="{}":
+ cd automations/js && node src/render-jinja.js {{ in_file }} {{ out_file }} {{ ctx }}
+
+# Render `.pre-commit-config.yaml`
+render-precommit:
+ just render .pre-commit-config.local.yaml.jinja .pre-commit-config.yaml
+
+# Render `prettier.config.js`
+render-prettier:
+ just render prettier.config.js.jinja prettier.config.js
diff --git a/package.json b/package.json
index 26317af3b..17688ae19 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,8 @@
"@octokit/rest": "19.0.5",
"js-yaml": "^4.1.0",
"k6": "0.0.0",
- "node-fetch": "^3.0.0"
+ "node-fetch": "^3.0.0",
+ "nunjucks": "^3.2.3"
},
"engines": {
"node": ">= 16.0.0 <17",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 20185265a..605aee54d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -5,30 +5,27 @@ specifiers:
js-yaml: ^4.1.0
k6: 0.0.0
node-fetch: ^3.0.0
+ nunjucks: ^3.2.3
dependencies:
'@octokit/rest': 19.0.5
js-yaml: 4.1.0
k6: 0.0.0
node-fetch: 3.2.9
+ nunjucks: 3.2.3
packages:
+
/@octokit/auth-token/3.0.0:
- resolution:
- {
- integrity: sha512-MDNFUBcJIptB9At7HiV7VCvU3NcL4GnfCQaP8C5lrxWrRPMJBnemYtehaKSOlaM7AYxeRyj9etenu8LVpSpVaQ==,
- }
- engines: { node: '>= 14' }
+ resolution: {integrity: sha512-MDNFUBcJIptB9At7HiV7VCvU3NcL4GnfCQaP8C5lrxWrRPMJBnemYtehaKSOlaM7AYxeRyj9etenu8LVpSpVaQ==}
+ engines: {node: '>= 14'}
dependencies:
'@octokit/types': 6.41.0
dev: false
/@octokit/core/4.1.0:
- resolution:
- {
- integrity: sha512-Czz/59VefU+kKDy+ZfDwtOIYIkFjExOKf+HA92aiTZJ6EfWpFzYQWw0l54ji8bVmyhc+mGaLUbSUmXazG7z5OQ==,
- }
- engines: { node: '>= 14' }
+ resolution: {integrity: sha512-Czz/59VefU+kKDy+ZfDwtOIYIkFjExOKf+HA92aiTZJ6EfWpFzYQWw0l54ji8bVmyhc+mGaLUbSUmXazG7z5OQ==}
+ engines: {node: '>= 14'}
dependencies:
'@octokit/auth-token': 3.0.0
'@octokit/graphql': 5.0.0
@@ -42,11 +39,8 @@ packages:
dev: false
/@octokit/endpoint/7.0.0:
- resolution:
- {
- integrity: sha512-Kz/mIkOTjs9rV50hf/JK9pIDl4aGwAtT8pry6Rpy+hVXkAPhXanNQRxMoq6AeRgDCZR6t/A1zKniY2V1YhrzlQ==,
- }
- engines: { node: '>= 14' }
+ resolution: {integrity: sha512-Kz/mIkOTjs9rV50hf/JK9pIDl4aGwAtT8pry6Rpy+hVXkAPhXanNQRxMoq6AeRgDCZR6t/A1zKniY2V1YhrzlQ==}
+ engines: {node: '>= 14'}
dependencies:
'@octokit/types': 6.41.0
is-plain-object: 5.0.0
@@ -54,11 +48,8 @@ packages:
dev: false
/@octokit/graphql/5.0.0:
- resolution:
- {
- integrity: sha512-1ZZ8tX4lUEcLPvHagfIVu5S2xpHYXAmgN0+95eAOPoaVPzCfUXJtA5vASafcpWcO86ze0Pzn30TAx72aB2aguQ==,
- }
- engines: { node: '>= 14' }
+ resolution: {integrity: sha512-1ZZ8tX4lUEcLPvHagfIVu5S2xpHYXAmgN0+95eAOPoaVPzCfUXJtA5vASafcpWcO86ze0Pzn30TAx72aB2aguQ==}
+ engines: {node: '>= 14'}
dependencies:
'@octokit/request': 6.2.0
'@octokit/types': 6.41.0
@@ -68,25 +59,16 @@ packages:
dev: false
/@octokit/openapi-types/12.11.0:
- resolution:
- {
- integrity: sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==,
- }
+ resolution: {integrity: sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==}
dev: false
/@octokit/openapi-types/14.0.0:
- resolution:
- {
- integrity: sha512-HNWisMYlR8VCnNurDU6os2ikx0s0VyEjDYHNS/h4cgb8DeOxQ0n72HyinUtdDVxJhFy3FWLGl0DJhfEWk3P5Iw==,
- }
+ resolution: {integrity: sha512-HNWisMYlR8VCnNurDU6os2ikx0s0VyEjDYHNS/h4cgb8DeOxQ0n72HyinUtdDVxJhFy3FWLGl0DJhfEWk3P5Iw==}
dev: false
/@octokit/plugin-paginate-rest/5.0.1_@[email protected]:
- resolution:
- {
- integrity: sha512-7A+rEkS70pH36Z6JivSlR7Zqepz3KVucEFVDnSrgHXzG7WLAzYwcHZbKdfTXHwuTHbkT1vKvz7dHl1+HNf6Qyw==,
- }
- engines: { node: '>= 14' }
+ resolution: {integrity: sha512-7A+rEkS70pH36Z6JivSlR7Zqepz3KVucEFVDnSrgHXzG7WLAzYwcHZbKdfTXHwuTHbkT1vKvz7dHl1+HNf6Qyw==}
+ engines: {node: '>= 14'}
peerDependencies:
'@octokit/core': '>=4'
dependencies:
@@ -95,10 +77,7 @@ packages:
dev: false
/@octokit/plugin-request-log/1.0.4_@[email protected]:
- resolution:
- {
- integrity: sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==,
- }
+ resolution: {integrity: sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==}
peerDependencies:
'@octokit/core': '>=3'
dependencies:
@@ -106,11 +85,8 @@ packages:
dev: false
/@octokit/plugin-rest-endpoint-methods/6.7.0_@[email protected]:
- resolution:
- {
- integrity: sha512-orxQ0fAHA7IpYhG2flD2AygztPlGYNAdlzYz8yrD8NDgelPfOYoRPROfEyIe035PlxvbYrgkfUZIhSBKju/Cvw==,
- }
- engines: { node: '>= 14' }
+ resolution: {integrity: sha512-orxQ0fAHA7IpYhG2flD2AygztPlGYNAdlzYz8yrD8NDgelPfOYoRPROfEyIe035PlxvbYrgkfUZIhSBKju/Cvw==}
+ engines: {node: '>= 14'}
peerDependencies:
'@octokit/core': '>=3'
dependencies:
@@ -120,11 +96,8 @@ packages:
dev: false
/@octokit/request-error/3.0.0:
- resolution:
- {
- integrity: sha512-WBtpzm9lR8z4IHIMtOqr6XwfkGvMOOILNLxsWvDwtzm/n7f5AWuqJTXQXdDtOvPfTDrH4TPhEvW2qMlR4JFA2w==,
- }
- engines: { node: '>= 14' }
+ resolution: {integrity: sha512-WBtpzm9lR8z4IHIMtOqr6XwfkGvMOOILNLxsWvDwtzm/n7f5AWuqJTXQXdDtOvPfTDrH4TPhEvW2qMlR4JFA2w==}
+ engines: {node: '>= 14'}
dependencies:
'@octokit/types': 6.41.0
deprecation: 2.3.1
@@ -132,11 +105,8 @@ packages:
dev: false
/@octokit/request/6.2.0:
- resolution:
- {
- integrity: sha512-7IAmHnaezZrgUqtRShMlByJK33MT9ZDnMRgZjnRrRV9a/jzzFwKGz0vxhFU6i7VMLraYcQ1qmcAOin37Kryq+Q==,
- }
- engines: { node: '>= 14' }
+ resolution: {integrity: sha512-7IAmHnaezZrgUqtRShMlByJK33MT9ZDnMRgZjnRrRV9a/jzzFwKGz0vxhFU6i7VMLraYcQ1qmcAOin37Kryq+Q==}
+ engines: {node: '>= 14'}
dependencies:
'@octokit/endpoint': 7.0.0
'@octokit/request-error': 3.0.0
@@ -149,11 +119,8 @@ packages:
dev: false
/@octokit/rest/19.0.5:
- resolution:
- {
- integrity: sha512-+4qdrUFq2lk7Va+Qff3ofREQWGBeoTKNqlJO+FGjFP35ZahP+nBenhZiGdu8USSgmq4Ky3IJ/i4u0xbLqHaeow==,
- }
- engines: { node: '>= 14' }
+ resolution: {integrity: sha512-+4qdrUFq2lk7Va+Qff3ofREQWGBeoTKNqlJO+FGjFP35ZahP+nBenhZiGdu8USSgmq4Ky3IJ/i4u0xbLqHaeow==}
+ engines: {node: '>= 14'}
dependencies:
'@octokit/core': 4.1.0
'@octokit/plugin-paginate-rest': 5.0.1_@[email protected]
@@ -164,112 +131,86 @@ packages:
dev: false
/@octokit/types/6.41.0:
- resolution:
- {
- integrity: sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==,
- }
+ resolution: {integrity: sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==}
dependencies:
'@octokit/openapi-types': 12.11.0
dev: false
/@octokit/types/8.0.0:
- resolution:
- {
- integrity: sha512-65/TPpOJP1i3K4lBJMnWqPUJ6zuOtzhtagDvydAWbEXpbFYA0oMKKyLb95NFZZP0lSh/4b6K+DQlzvYQJQQePg==,
- }
+ resolution: {integrity: sha512-65/TPpOJP1i3K4lBJMnWqPUJ6zuOtzhtagDvydAWbEXpbFYA0oMKKyLb95NFZZP0lSh/4b6K+DQlzvYQJQQePg==}
dependencies:
'@octokit/openapi-types': 14.0.0
dev: false
+ /a-sync-waterfall/1.0.1:
+ resolution: {integrity: sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==}
+ dev: false
+
/argparse/2.0.1:
- resolution:
- {
- integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==,
- }
+ resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
+ dev: false
+
+ /asap/2.0.6:
+ resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==}
dev: false
/before-after-hook/2.2.2:
- resolution:
- {
- integrity: sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==,
- }
+ resolution: {integrity: sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==}
+ dev: false
+
+ /commander/5.1.0:
+ resolution: {integrity: sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==}
+ engines: {node: '>= 6'}
dev: false
/data-uri-to-buffer/4.0.0:
- resolution:
- {
- integrity: sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==,
- }
- engines: { node: '>= 12' }
+ resolution: {integrity: sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==}
+ engines: {node: '>= 12'}
dev: false
/deprecation/2.3.1:
- resolution:
- {
- integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==,
- }
+ resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==}
dev: false
/fetch-blob/3.2.0:
- resolution:
- {
- integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==,
- }
- engines: { node: ^12.20 || >= 14.13 }
+ resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
+ engines: {node: ^12.20 || >= 14.13}
dependencies:
node-domexception: 1.0.0
web-streams-polyfill: 3.2.1
dev: false
/formdata-polyfill/4.0.10:
- resolution:
- {
- integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==,
- }
- engines: { node: '>=12.20.0' }
+ resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}
+ engines: {node: '>=12.20.0'}
dependencies:
fetch-blob: 3.2.0
dev: false
/is-plain-object/5.0.0:
- resolution:
- {
- integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==,
- }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==}
+ engines: {node: '>=0.10.0'}
dev: false
/js-yaml/4.1.0:
- resolution:
- {
- integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==,
- }
+ resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
hasBin: true
dependencies:
argparse: 2.0.1
dev: false
/k6/0.0.0:
- resolution:
- {
- integrity: sha512-GAQSWayS2+LjbH5bkRi+pMPYyP1JSp7o+4j58ANZ762N/RH/SdlAT3CHHztnn8s/xgg8kYNM24Gd2IPo9b5W+g==,
- }
+ resolution: {integrity: sha512-GAQSWayS2+LjbH5bkRi+pMPYyP1JSp7o+4j58ANZ762N/RH/SdlAT3CHHztnn8s/xgg8kYNM24Gd2IPo9b5W+g==}
dev: false
/node-domexception/1.0.0:
- resolution:
- {
- integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==,
- }
- engines: { node: '>=10.5.0' }
+ resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
+ engines: {node: '>=10.5.0'}
dev: false
/node-fetch/2.6.7:
- resolution:
- {
- integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==,
- }
- engines: { node: 4.x || >=6.0.0 }
+ resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==}
+ engines: {node: 4.x || >=6.0.0}
peerDependencies:
encoding: ^0.1.0
peerDependenciesMeta:
@@ -280,68 +221,59 @@ packages:
dev: false
/node-fetch/3.2.9:
- resolution:
- {
- integrity: sha512-/2lI+DBecVvVm9tDhjziTVjo2wmTsSxSk58saUYP0P/fRJ3xxtfMDY24+CKTkfm0Dlhyn3CSXNL0SoRiCZ8Rzg==,
- }
- engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
+ resolution: {integrity: sha512-/2lI+DBecVvVm9tDhjziTVjo2wmTsSxSk58saUYP0P/fRJ3xxtfMDY24+CKTkfm0Dlhyn3CSXNL0SoRiCZ8Rzg==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
data-uri-to-buffer: 4.0.0
fetch-blob: 3.2.0
formdata-polyfill: 4.0.10
dev: false
+ /nunjucks/3.2.3:
+ resolution: {integrity: sha512-psb6xjLj47+fE76JdZwskvwG4MYsQKXUtMsPh6U0YMvmyjRtKRFcxnlXGWglNybtNTNVmGdp94K62/+NjF5FDQ==}
+ engines: {node: '>= 6.9.0'}
+ hasBin: true
+ peerDependencies:
+ chokidar: ^3.3.0
+ peerDependenciesMeta:
+ chokidar:
+ optional: true
+ dependencies:
+ a-sync-waterfall: 1.0.1
+ asap: 2.0.6
+ commander: 5.1.0
+ dev: false
+
/once/1.4.0:
- resolution:
- {
- integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==,
- }
+ resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
dependencies:
wrappy: 1.0.2
dev: false
/tr46/0.0.3:
- resolution:
- {
- integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==,
- }
+ resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
dev: false
/universal-user-agent/6.0.0:
- resolution:
- {
- integrity: sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==,
- }
+ resolution: {integrity: sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==}
dev: false
/web-streams-polyfill/3.2.1:
- resolution:
- {
- integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==,
- }
- engines: { node: '>= 8' }
+ resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==}
+ engines: {node: '>= 8'}
dev: false
/webidl-conversions/3.0.1:
- resolution:
- {
- integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==,
- }
+ resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
dev: false
/whatwg-url/5.0.0:
- resolution:
- {
- integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==,
- }
+ resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
dependencies:
tr46: 0.0.3
webidl-conversions: 3.0.1
dev: false
/wrappy/1.0.2:
- resolution:
- {
- integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==,
- }
+ resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
dev: false
diff --git a/prettier.config.frontend.js.jinja b/prettier.config.frontend.js.jinja
new file mode 100644
index 000000000..3b5d2717a
--- /dev/null
+++ b/prettier.config.frontend.js.jinja
@@ -0,0 +1,12 @@
+{% extends 'prettier.config.js.jinja' %}
+
+{% block note %}
+{{ super() }}
+// - https://github.com/WordPress/openverse/blob/main/prettier.config.frontend.js.jinja
+{%- endblock %}
+
+{% block additional_config %}
+ vueIndentScriptAndStyle: false,
+ plugins: [require('prettier-plugin-tailwindcss')],
+ tailwindConfig: 'tailwind.config.js',
+{% endblock %}
diff --git a/prettier.config.js b/prettier.config.js
index c217b8b0c..b48775a1a 100644
--- a/prettier.config.js
+++ b/prettier.config.js
@@ -1,3 +1,7 @@
+// This file is being synced from WordPress/openverse. Any changes made to it
+// here will be overwritten. Please make any necessary edits to these files:
+// - https://github.com/WordPress/openverse/blob/main/prettier.config.js.jinja
+
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
diff --git a/prettier.config.js.jinja b/prettier.config.js.jinja
new file mode 100644
index 000000000..fd0f17724
--- /dev/null
+++ b/prettier.config.js.jinja
@@ -0,0 +1,23 @@
+{% block note %}
+// This file is being synced from WordPress/openverse. Any changes made to it
+// here will be overwritten. Please make any necessary edits to these files:
+// - https://github.com/WordPress/openverse/blob/main/prettier.config.js.jinja
+{%- endblock %}
+
+{# This comment adds a blank line. #}
+module.exports = {
+ trailingComma: 'es5',
+ tabWidth: 2,
+ semi: false,
+ singleQuote: true,
+ overrides: [
+ {
+ files: '*.yml',
+ options: {
+ singleQuote: false,
+ },
+ },
+ ],
+ {% block additional_config %}
+ {% endblock %}
+}