Skip to content

Commit

Permalink
Switch from black to ruff for code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
robhudson committed Jan 17, 2024
1 parent 00a7219 commit 2f83ec9
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 54 deletions.
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ repos:
rev: v0.1.11
hooks:
- id: ruff
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
hooks:
- id: black
language_version: python3
- id: ruff-format
- repo: https://github.com/mozilla-l10n/moz-fluent-linter
rev: v0.4.5
hooks:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ lint: .docker-build-pull

format: .docker-build-pull
${DC} run assets npm run format
${DC} run app black .
${DC} run app ruff format .

test: .docker-build-pull
${DC} run --rm test
Expand Down
4 changes: 3 additions & 1 deletion bedrock/contentful/management/commands/update_contentful.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,9 @@ def _page_is_syncable(
def _get_content_to_sync(
self,
available_locales,
) -> list((str, str),):
) -> list(
(str, str),
):
"""Fetches which content types and ids to query, individually, from the Contentful API"""
content_to_sync = []

Expand Down
2 changes: 1 addition & 1 deletion bin/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

ruff check .
black --check .
ruff format --check .
moz-l10n-lint l10n/l10n-pontoon.toml
moz-l10n-lint l10n/l10n-vendor.toml
moz-l10n-lint l10n-pocket/l10n-vendor.toml
Expand Down
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,3 @@ combine-as-imports = true

[tool.ruff.isort.sections]
django = ["django"]

[tool.black]
line-length = 150 # To match flake8
target-version = ['py39']
include = '\.pyi?$'
1 change: 0 additions & 1 deletion requirements/dev.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-r prod.txt

black==23.12.1
bpython==0.24
braceexpand==0.1.7
factory-boy==3.3.0
Expand Down
40 changes: 0 additions & 40 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,6 @@ beautifulsoup4==4.12.2 \
--hash=sha256:492bbc69dca35d12daac71c4db1bfff0c876c00ef4a2ffacce226d4638eb72da \
--hash=sha256:bd2520ca0d9d7d12694a53d44ac482d181b4ec1888909b035a3dbf40d0f57d4a
# via -r requirements/prod.txt
black==23.12.1 \
--hash=sha256:0808494f2b2df923ffc5723ed3c7b096bd76341f6213989759287611e9837d50 \
--hash=sha256:1fa88a0f74e50e4487477bc0bb900c6781dbddfdfa32691e780bf854c3b4a47f \
--hash=sha256:25e57fd232a6d6ff3f4478a6fd0580838e47c93c83eaf1ccc92d4faf27112c4e \
--hash=sha256:2d9e13db441c509a3763a7a3d9a49ccc1b4e974a47be4e08ade2a228876500ec \
--hash=sha256:3e1b38b3135fd4c025c28c55ddfc236b05af657828a8a6abe5deec419a0b7055 \
--hash=sha256:3fa4be75ef2a6b96ea8d92b1587dd8cb3a35c7e3d51f0738ced0781c3aa3a5a3 \
--hash=sha256:4ce3ef14ebe8d9509188014d96af1c456a910d5b5cbf434a09fef7e024b3d0d5 \
--hash=sha256:4f0031eaa7b921db76decd73636ef3a12c942ed367d8c3841a0739412b260a54 \
--hash=sha256:602cfb1196dc692424c70b6507593a2b29aac0547c1be9a1d1365f0d964c353b \
--hash=sha256:6d1bd9c210f8b109b1762ec9fd36592fdd528485aadb3f5849b2740ef17e674e \
--hash=sha256:78baad24af0f033958cad29731e27363183e140962595def56423e626f4bee3e \
--hash=sha256:8d4df77958a622f9b5a4c96edb4b8c0034f8434032ab11077ec6c56ae9f384ba \
--hash=sha256:97e56155c6b737854e60a9ab1c598ff2533d57e7506d97af5481141671abf3ea \
--hash=sha256:9c4352800f14be5b4864016882cdba10755bd50805c95f728011bcb47a4afd59 \
--hash=sha256:a4d6a9668e45ad99d2f8ec70d5c8c04ef4f32f648ef39048d010b0689832ec6d \
--hash=sha256:a920b569dc6b3472513ba6ddea21f440d4b4c699494d2e972a1753cdc25df7b0 \
--hash=sha256:ae76c22bde5cbb6bfd211ec343ded2163bba7883c7bc77f6b756a1049436fbb9 \
--hash=sha256:b18fb2ae6c4bb63eebe5be6bd869ba2f14fd0259bda7d18a46b764d8fb86298a \
--hash=sha256:c04b6d9d20e9c13f43eee8ea87d44156b8505ca8a3c878773f68b4e4812a421e \
--hash=sha256:c88b3711d12905b74206227109272673edce0cb29f27e1385f33b0163c414bba \
--hash=sha256:dd15245c8b68fe2b6bd0f32c1556509d11bb33aec9b5d0866dd8e2ed3dba09c2 \
--hash=sha256:e0aaf6041986767a5e0ce663c7a2f0e9eaf21e6ff87a5f95cbf3675bfd4c41d2
# via -r requirements/dev.in
bleach[css]==6.1.0 \
--hash=sha256:0a31f1837963c41d46bbf1331b8778e1308ea0791db03cc4e7357b97cf42a8fe \
--hash=sha256:3225f354cfc436b9789c66c4ee030194bee0568fbf9cbdad3bc8b5c26c5f12b6
Expand Down Expand Up @@ -274,7 +250,6 @@ click==8.1.7 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via
# -r requirements/prod.txt
# black
# glean-parser
commonware==0.6.0 \
--hash=sha256:0e9520986e292f2bf8cdf80b32f21ef01e4058fd7baa61d2d282d21ed7085b1f \
Expand Down Expand Up @@ -888,10 +863,6 @@ mdx-outline @ https://github.com/mozmeao/mdx_outline/archive/refs/tags/markdown-
meinheld==1.0.2 \
--hash=sha256:008c76937ac2117cc69e032dc69cea9f85fc605de9bac1417f447c41c16a56d6
# via -r requirements/prod.txt
mypy-extensions==1.0.0 \
--hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \
--hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782
# via black
newrelic==9.3.0 \
--hash=sha256:1ce38949404e974b566b21487394f5ea36a1fb80ba36cc4a6e8fb968d2e150ab \
--hash=sha256:2187078d7b0054b30f39dbf891cb2caa71a7046f6d0258fb8c0fcfce70777774 \
Expand All @@ -918,18 +889,13 @@ packaging==23.2 \
--hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7
# via
# -r requirements/prod.txt
# black
# django-allow-cidr
# pytest
# pytest-rerunfailures
parsimonious==0.10.0 \
--hash=sha256:8281600da180ec8ae35427a4ab4f7b82bfec1e3d1e52f80cb60ea82b9512501c \
--hash=sha256:982ab435fabe86519b57f6b35610aa4e4e977e9f02a14353edf4bbc75369fc0f
# via cl-ext-lang
pathspec==0.12.1 \
--hash=sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08 \
--hash=sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712
# via black
pillow==10.2.0 \
--hash=sha256:0304004f8067386b477d20a518b50f3fa658a28d44e4116970abfcd94fac34a8 \
--hash=sha256:0689b5a8c5288bc0504d9fcee48f61a6a586b9b98514d7d29b840143d6734f39 \
Expand Down Expand Up @@ -1004,10 +970,6 @@ pipdeptree==2.13.1 \
--hash=sha256:1e1acdb2ddc2abdca1718f27ca8dc21622c896a00b8980ec3d42c2208a841a10 \
--hash=sha256:760fa0d93f424637445a9e7ca797bf64f283e824cbeadc61f761e12b722bb004
# via -r requirements/dev.in
platformdirs==4.1.0 \
--hash=sha256:11c8f37bcca40db96d8144522d925583bdb7a31f7b0e37e3ed4318400a8e2380 \
--hash=sha256:906d548203468492d432bcb294d4bc2fff751bf84971fbb2c10918cc206ee420
# via black
pluggy==1.3.0 \
--hash=sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12 \
--hash=sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7
Expand Down Expand Up @@ -1551,7 +1513,6 @@ tomli==2.0.1 \
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
# via
# black
# coverage
# pytest
translate-toolkit==3.12.1 \
Expand All @@ -1574,7 +1535,6 @@ typing-extensions==4.9.0 \
# via
# -r requirements/prod.txt
# asgiref
# black
# fluent-runtime
# fluent-syntax
# pygithub
Expand Down

0 comments on commit 2f83ec9

Please sign in to comment.