Skip to content

Commit e7c5634

Browse files
[pre-commit] Start using ruff-format instead of black
1 parent 0cb9d50 commit e7c5634

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ repos:
1414
hooks:
1515
- id: ruff
1616
args: ["--fix"]
17+
- id: ruff-format
1718
- repo: https://github.com/tox-dev/pyproject-fmt
1819
rev: "v2.5.1"
1920
hooks:
2021
- id: pyproject-fmt
21-
- repo: https://github.com/psf/black
22-
rev: 25.1.0
23-
hooks:
24-
- id: black
25-
args: [--line-length, "120"]
2622
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker/
2723
rev: v1.1.3
2824
hooks:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ optional-dependencies.dev = [
5454
"coveralls",
5555
"django-rosetta",
5656
"pre-commit",
57-
"pylint>=3.3.1",
57+
"pylint>=3.3.5",
5858
"pylint-django",
5959
"pysankeybeta~=1.3.0",
6060
"pytest",

survey/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def get_question_initial(self, question, data):
181181
if data:
182182
# Initialize the field field from a POST request, if any.
183183
# Replace values from the database
184-
initial = data.get("question_%d" % question.pk)
184+
initial = data.get(f"question_{question.pk}")
185185
return initial
186186

187187
def get_question_widget(self, question):
@@ -243,7 +243,7 @@ def add_question(self, question, data):
243243
if question.type == Question.DATE:
244244
field.widget.attrs["class"] = "date"
245245
# logging.debug("Field for %s : %s", question, field.__dict__)
246-
self.fields["question_%d" % question.pk] = field
246+
self.fields[f"question_{question.pk}"] = field
247247

248248
def has_next_step(self):
249249
if not self.survey.is_all_in_one_page():

0 commit comments

Comments
 (0)