Skip to content

Commit 6c2415f

Browse files
committedApr 3, 2024
- preparing for pre-commit hooks and djlint reformatting
1 parent f89c983 commit 6c2415f

12 files changed

+33
-6
lines changed
 

‎.pre-commit-config.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
repos:
2+
- repo: https://github.com/psf/black-pre-commit-mirror
3+
rev: 24.3.0
4+
hooks:
5+
- id: black
6+
language_version: python3.11
7+
8+
- repo: https://github.com/djlint/djLint
9+
rev: v1.34.1
10+
hooks:
11+
- id: djlint-reformat-django
12+
# - id: djlint-django

‎NEMO/static/nemo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ function set_start_end_datetime_pickers(start_jq, end_jq, properties, set_end_da
771771

772772
function sort_compare(element)
773773
{
774-
return element.innerText.toLowerCase();
774+
return element.innerText.toLowerCase().trim();
775775
}
776776

777777
function sort_elements(list_element, selector, sort_function)

‎NEMO/templates/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
{% endif %}
8484
{# Content goes here #}
8585
{% block content %}{% endblock %}
86-
<div class="modal-footer">{% block footer %}{% endblock %}</div>
86+
{% spaceless %}<div class="modal-footer">{% block footer %}{% endblock %}</div>{% endspaceless %}
8787
</div>
8888
{% block extra_whitespace %}
8989
<div style="height: 200px"></div>

‎NEMO/templates/base/popup.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ <h4 id="modal-description-label" class="modal-title">{% block title %}{% endbloc
55
<div class="modal-body">
66
{% block content %}{% endblock %}
77
</div>
8-
<div class="modal-footer">{% block footer %}{% endblock %}</div>
8+
{% spaceless %}<div class="modal-footer">{% block footer %}{% endblock %}</div>{% endspaceless %}

‎NEMO/templates/calendar/configuration_event_feed.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{# djlint:off #}
12
[
23
{% for x in events %}
34
{

‎NEMO/templates/calendar/reservation_event_feed.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{# djlint:off #}
12
[
23
{% for x in events %}
34
{

‎NEMO/templates/calendar/specific_user_feed.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{# djlint:off #}
12
[
23
{% for x in usage_events %}
34
{

‎NEMO/templates/calendar/usage_event_feed.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{# djlint:off #}
12
[
23
{% for x in usage_events %}
34
{

‎NEMO/templates/customizations/customizations_templates.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ <h3 class="customization-section-title" id="weekend_access_email_id">Weekend acc
428428
<script>
429429
function sort_comp(element)
430430
{
431-
return element.getElementsByTagName("h3")[0].innerText.toLowerCase();
431+
return element.getElementsByTagName("h3")[0].innerText.toLowerCase().trim();
432432
}
433433

434434
window.addEventListener("load", function ()

‎README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
1+
[![Code style: black](https://img.shields.io/badge/python%20style-black-000000.svg)](https://github.com/psf/black)
2+
[![Code style: djlint](https://img.shields.io/badge/html%20style-djlint-black.svg)](https://www.djlint.com)
23
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/NEMO?label=python)](https://www.python.org/downloads/release/python-380/)
34
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/nanofab/nemo?label=NEMO%20docker%20version)](https://hub.docker.com/r/nanofab/nemo)
45
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/usnistgov/nemo?label=NEMO%20github%20version)](https://github.com/usnistgov/NEMO/releases)

‎pyproject.toml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[tool.black]
2+
line-length = 120
3+
target-version = ['py311']
4+
5+
[tool.djlint]
6+
profile = "django"
7+
max_attribute_length=100
8+
max_line_length=120
9+
ignore = "H031"

‎setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="NEMO",
5-
version="5.3.1",
5+
version="5.4.0",
66
python_requires=">=3.8, <4",
77
packages=find_namespace_packages(exclude=["resources", "resources.*", "build", "build.*"]),
88
include_package_data=True,
@@ -43,6 +43,7 @@
4343
"pytz==2024.1",
4444
"requests==2.31.0",
4545
],
46+
extras_require={"dev-tools": ["pre-commit", "djlint", "black"]},
4647
entry_points={
4748
"console_scripts": ["nemo=NEMO.provisioning:entry_point"],
4849
},

0 commit comments

Comments
 (0)
Please sign in to comment.