Skip to content

Commit aa66403

Browse files
authored
Updated pre-commit hooks to entire codebase. (#588)
1 parent 56f1396 commit aa66403

File tree

15 files changed

+20
-48
lines changed

15 files changed

+20
-48
lines changed

.github/workflows/heroku-deploy.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Deploy # The name of the workflow
2-
on:
2+
on:
33
push:
44
branches:
55
- main #Launch the action on every push on the branch main
@@ -10,21 +10,9 @@ jobs:
1010
- uses: actions/checkout@v2 # This actions copy the repository on the environment
1111
- name: Install Heroku CLI # <- IMPORTANT!!! Make sure the cli is installed before using the action
1212
run: |
13-
curl https://cli-assets.heroku.com/install.sh | sh
13+
curl https://cli-assets.heroku.com/install.sh | sh
1414
- uses: akhileshns/[email protected] # This action deploys the content on Heroku
1515
with:
1616
heroku_api_key: ${{secrets.HEROKU_API_KEY}} #The Heroku api key we stored on our repo secret
1717
heroku_app_name: "djangosnippets" #The name of your heroku app - Must be unique in Heroku
1818
heroku_email: "[email protected]" #Your heroku yuser name
19-
20-
21-
22-
23-
24-
25-
26-
27-
28-
29-
30-

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ cython_debug/
175175
.abstra/
176176

177177
# Visual Studio Code
178-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
178+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
179179
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
180-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
180+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
181181
# you could uncomment the following to ignore the entire vscode folder
182182
# .vscode/
183183

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.11
1+
3.11

base/pagination.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ def page_range(self):
3030
"""
3131
Returns the full range of pages.
3232
"""
33-
return (
34-
self.paginator.get_elided_page_range(self.page_num)
35-
if self.multi_page
36-
else []
37-
)
33+
return self.paginator.get_elided_page_range(self.page_num) if self.multi_page else []
3834

3935
def setup(self):
4036
paginator = Paginator(self.queryset, self.list_per_page)

base/templatetags/base_templatetags.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,11 @@ def querystring(context, *args, **kwargs):
5050
for d in [*args, kwargs]:
5151
if not isinstance(d, Mapping):
5252
raise TemplateSyntaxError(
53-
"querystring requires mappings for positional arguments (got "
54-
"%r instead)." % d
53+
"querystring requires mappings for positional arguments (got " "%r instead)." % d
5554
)
5655
for key, value in d.items():
5756
if not isinstance(key, str):
58-
raise TemplateSyntaxError(
59-
"querystring requires strings for mapping keys (got %r "
60-
"instead)." % key
61-
)
57+
raise TemplateSyntaxError("querystring requires strings for mapping keys (got %r " "instead)." % key)
6258
if value is None:
6359
params.pop(key, None)
6460
elif isinstance(value, Iterable) and not isinstance(value, str):

base/tests/migrations/0002_fish.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
class Migration(migrations.Migration):
77

88
dependencies = [
9-
('tests', '0001_initial'),
9+
("tests", "0001_initial"),
1010
]
1111

1212
operations = [
1313
migrations.CreateModel(
14-
name='Fish',
14+
name="Fish",
1515
fields=[
16-
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
17-
('name', models.CharField(max_length=255)),
18-
('price', models.IntegerField()),
16+
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
17+
("name", models.CharField(max_length=255)),
18+
("price", models.IntegerField()),
1919
],
2020
),
2121
]

cab/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def validate_non_whitespace_only_string(value):
1010
the string to treat strings with only whitespaces in them as empty.
1111
"""
1212
if not value or not value.strip():
13-
raise forms.ValidationError(u"This field is required", code="required")
13+
raise forms.ValidationError("This field is required", code="required")
1414

1515

1616
class SnippetForm(forms.ModelForm):

djangosnippets/static/css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6896,4 +6896,4 @@ footer .heroku {
68966896

68976897
a.button:hover {
68986898
text-decoration: none
6899-
}
6899+
}

djangosnippets/templates/cab/partials/language_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% load static components %}
22

33

4-
<img class="bars" src="{% static 'img/bars.svg' %}"/>
4+
<img class="bars" src="{% static 'img/bars.svg' %}"/>
55
<h1>All languages</h1>
66
<div id="content">
77
<ul>

djangosnippets/templates/cab/partials/most_bookmarked.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,3 @@ <h3>Filter by date</h3>
5353

5454
<p><a rel="alternate" href="{% url 'cab_feed_latest' %}" type="application/atom+xml"><i class="fa fa-fw fa-rss-square"></i>Feed of latest snippets</a></p>
5555
</div>
56-
57-
58-
59-
60-
61-

0 commit comments

Comments
 (0)