Skip to content

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

🔄 Synced file(s) with WordPress/openverse (#1016)

Openverse (Bot)55f55de18766
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index e8b6d14f8..4ba3de21b 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -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/.pre-commit-config.yaml.jinja
+
exclude: Pipfile\.lock|migrations|\.idea|node_modules|archive
repos:
@@ -6,22 +10,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 +36,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 +46,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
@@ -56,20 +62,14 @@ repos:
args:
- --safe
- - repo: https://github.com/pre-commit/mirrors-eslint
- rev: v8.3.0
- hooks:
- - id: eslint
- files: ^js/.*$
- 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
diff --git a/api/docs/_static/_css/brand.css b/api/docs/_static/_css/brand.css
index c5c7b8dfe..eaf865706 100644
--- a/api/docs/_static/_css/brand.css
+++ b/api/docs/_static/_css/brand.css
@@ -2,12 +2,12 @@
color: black;
}
-body[data-theme="dark"] .sidebar-logo-container {
+body[data-theme='dark'] .sidebar-logo-container {
color: white;
}
@media (prefers-color-scheme: dark) {
- body:not([data-theme="light"]) .sidebar-logo-container {
+ body:not([data-theme='light']) .sidebar-logo-container {
color: white;
}
}
diff --git a/prettier.config.js b/prettier.config.js
new file mode 100644
index 000000000..b48775a1a
--- /dev/null
+++ b/prettier.config.js
@@ -0,0 +1,18 @@
+// 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,
+ semi: false,
+ singleQuote: true,
+ overrides: [
+ {
+ files: '*.yml',
+ options: {
+ singleQuote: false,
+ },
+ },
+ ],
+}