Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal changes introduced by Ruff formatter after double quotes enfo… #7901

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@ repos:
hooks:
- id: ruff
args: [--fix]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3.9
- id: ruff-format
exclude: ^treeherder/.*/migrations
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ mkdocs = { version = "==1.4.2", optional = true }
mkdocs-material = { version = "==8.5.11", optional = true }
mdx_truly_sane_lists = { version = "1.3", optional = true }

[tool.black]
line-length = 100
target-version = ['py39']
include = '\.pyi?$'

[tool.ruff]
# Same as Black.
line-length = 100
Expand All @@ -46,9 +41,12 @@ select = [

ignore = [
# E501: line too long
"E501"
"E501",
]

# Also lint/format pyi files
extend-include = ["*.pyi"]

[tool.ruff.per-file-ignores]
# Ignore `module-import-not-at-top-of-file` rule of `pycodestyle`
"treeherder/model/models.py" = ["E402"]
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_email_is_still_sent_if_context_is_too_corrupt_to_be_actionable(
record_ready_for_processing,
sherlock_settings,
broken_context_str,
tc_notify_mock
tc_notify_mock,
# Note: parametrizes the test
):
record_ready_for_processing.context = broken_context_str
Expand Down
4 changes: 1 addition & 3 deletions treeherder/perf/management/commands/reassign_perf_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ def add_arguments(self, parser):
metavar="USE CASE",
help="""Rename "old" Raptor tp6 subtests, by pointing perf alerts & datum to new signatures.
Cannot be used in conjunction with --from/--to arguments.
Available use cases: {}""".format(
",".join(USE_CASES)
),
Available use cases: {}""".format(",".join(USE_CASES)),
)
parser.add_argument(
"--keep-leftovers",
Expand Down
6 changes: 2 additions & 4 deletions treeherder/perf/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,7 @@ def save(self, *args, **kwargs):
# or absence of a related summary
if self.related_summary and self.status not in self.RELATIONAL_STATUS_IDS:
raise ValidationError(
"Related summary set but status not in "
"'{}'!".format(
"Related summary set but status not in " "'{}'!".format(
", ".join(
[
STATUS[1]
Expand All @@ -548,8 +547,7 @@ def save(self, *args, **kwargs):
)
if not self.related_summary and self.status not in self.UNRELATIONAL_STATUS_IDS:
raise ValidationError(
"Related summary not set but status not in "
"'{}'!".format(
"Related summary not set but status not in " "'{}'!".format(
", ".join(
[
STATUS[1]
Expand Down
4 changes: 1 addition & 3 deletions treeherder/webapp/api/performance_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,9 +751,7 @@ def list(self, request):
"push_timestamp",
"push__revision",
"performancedatumreplicate__value",
).order_by(
"push_timestamp", "push_id", "job_id"
):
).order_by("push_timestamp", "push_id", "job_id"):
if replicate_value is not None:
item["data"].append(
{
Expand Down