Skip to content

Commit

Permalink
Merge branch 'main' into ring-ring-ring-csvupload
Browse files Browse the repository at this point in the history
  • Loading branch information
Darwinkel authored Aug 25, 2023
2 parents 47b9ba0 + b40d59a commit 91e04b3
Show file tree
Hide file tree
Showing 114 changed files with 2,538 additions and 2,373 deletions.
213 changes: 108 additions & 105 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,118 +1,121 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
args: ["--fix=lf"]
- id: detect-private-key
- id: check-case-conflict
- id: check-yaml
- id: check-json
- id: check-toml
- id: debug-statements
- id: end-of-file-fixer
exclude: |
(?x)(
^boefjes/tests/examples/rdns-nxdomain.txt$
)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
args: ["--fix=lf"]
- id: detect-private-key
- id: check-case-conflict
- id: check-yaml
- id: check-json
- id: check-toml
- id: debug-statements
- id: end-of-file-fixer
exclude: |
(?x)(
^boefjes/tests/examples/rdns-nxdomain.txt$
)
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.2
hooks:
- id: validate-pyproject
files: pyproject.toml$
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.2
hooks:
- id: validate-pyproject
files: pyproject.toml$

- repo: https://github.com/rstcheck/rstcheck
rev: v6.1.2
hooks:
- id: rstcheck
# https://github.com/rstcheck/rstcheck-core/issues/4
args: ["--ignore-messages", "Hyperlink target .* is not referenced", "--ignore-directives", "mermaid"]
additional_dependencies: ["rstcheck[sphinx]"]
- repo: https://github.com/rstcheck/rstcheck
rev: v6.1.2
hooks:
- id: rstcheck
# https://github.com/rstcheck/rstcheck-core/issues/4
args: ["--ignore-messages", "Hyperlink target .* is not referenced", "--ignore-directives", "mermaid"]
additional_dependencies: ["rstcheck[sphinx]"]

- repo: https://github.com/MarketSquare/robotframework-tidy
rev: "4.1.0"
hooks:
- id: robotidy
- repo: https://github.com/MarketSquare/robotframework-tidy
rev: "4.1.0"
hooks:
- id: robotidy

- repo: https://github.com/jendrikseipp/vulture
rev: v2.7
hooks:
- id: vulture
exclude: |
/tests/
- repo: https://github.com/jendrikseipp/vulture
rev: v2.7
hooks:
- id: vulture
exclude: |
/tests/
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.263'
hooks:
- id: ruff
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.263'
hooks:
- id: ruff

- repo: https://github.com/psf/black
rev: "23.3.0"
hooks:
- id: black
- repo: https://github.com/psf/black
rev: "23.3.0"
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
hooks:
- id: mypy
additional_dependencies: ['types-PyYAML', 'types-requests', 'types-cachetools', 'pydantic', 'pynacl']
exclude: |
(?x)(
^boefjes/ |
^keiko/templates |
^mula/whitelist\.py$ |
^octopoes/ |
^rocky/ |
/tests/ |
docs/source/conf\.py$ |
setup\.py$
)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
hooks:
- id: mypy
additional_dependencies: ['types-PyYAML', 'types-requests', 'types-cachetools', 'pydantic', 'pynacl']
exclude: |
(?x)(
^boefjes/ |
^keiko/templates |
^mula/whitelist\.py$ |
^octopoes/ |
^rocky/ |
/tests/ |
docs/source/conf\.py$ |
setup\.py$
)
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
additional_dependencies: ['tomli']
args: [-L, lama]
exclude: |
(?x)(
\.po$ |
\.xml$ |
poetry.lock$ |
pyproject.toml$ |
requirements-.*.txt$ |
retirejs.json$ |
^boefjes/boefjes/plugins/kat_fierce/lists |
^boefjes/tests/examples |
^keiko/glossaries |
^keiko/templates/.*/template.tex$ |
^rocky/assets/js/vendor |
^rocky/assets/src/bundles/app/css/themes/soft/fonts/tabler-icons/tabler-icons.scss$ |
^rocky/tests/stubs |
^docs/source/_static
)
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
additional_dependencies: ['tomli']
args: [-L, lama]
exclude: |
(?x)(
\.po$ |
\.xml$ |
poetry.lock$ |
pyproject.toml$ |
requirements-.*.txt$ |
retirejs.json$ |
^boefjes/boefjes/plugins/kat_fierce/lists |
^boefjes/tests/examples |
^keiko/glossaries |
^keiko/templates/.*/template.tex$ |
^rocky/assets/js/vendor |
^rocky/assets/src/bundles/app/css/themes/soft/fonts/tabler-icons/tabler-icons.scss$ |
^rocky/tests/stubs |
^docs/source/_static
)
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.19.16
hooks:
- id: djlint-django
files: '^rocky/.*/templates/.*$'
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.32.1
hooks:
- id: djlint-reformat-django
files: '^rocky/.*/templates/.*$'

# - repo: https://github.com/thibaudcolas/pre-commit-stylelint
# rev: v15.4.0
# hooks:
# - id: stylelint
# args: [--fix]
# additional_dependencies:
# - [email protected]
# - [email protected]
# files: "^(rocky\/assets\/src\/|docs\/source\/).*.(css|scss|sass)$"
- id: djlint-django
files: '^rocky/.*/templates/.*$'

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
hooks:
- id: shellcheck
args: ["-e", "SC1091"]
# - repo: https://github.com/thibaudcolas/pre-commit-stylelint
# rev: v15.4.0
# hooks:
# - id: stylelint
# args: [--fix]
# additional_dependencies:
# - [email protected]
# - [email protected]
# files: "^(rocky\/assets\/src\/|docs\/source\/).*.(css|scss|sass)$"

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
hooks:
- id: shellcheck
args: ["-e", "SC1091"]
26 changes: 11 additions & 15 deletions rocky/account/templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,32 @@ <h1>{% trans "You are logged in." %}</h1>
<p>{% translate "Two factor authentication is enabled for your account." %}</p>
{% else %}
<p>{% translate "Two factor authentication is not enabled for your account. Enable it to continue." %}</p>
<a class="button" href="{% url "setup" %}" class="a-button">{% trans "Setup two factor authentication" %}</a>
<a class="button a-button" href="{% url "setup" %}">{% trans "Setup two factor authentication" %}</a>
{% endif %}
{% else %}
<h1>{% translate "Login" %}</h1>
<form action="" method="post" class="help">
{% csrf_token %}
<fieldset>
{% if wizard.steps.current == "auth" %}
<legend>
{% translate "Credentials" %}
</legend>
<legend>{% translate "Credentials" %}</legend>
{% elif wizard.steps.current == "token" %}
<p class="explanation"
role="group"
aria-label="{% translate "explanation" %}">
role="group"
aria-label="{% translate "explanation" %}">
<span>{% translate "Explanation" %}:</span>
{% translate "Please enter the token generated by your token generator." %}
</p>
{% elif wizard.steps.current == "backup" %}
<p class="explanation"
role="group"
aria-label="{% translate "explanation" %}">
role="group"
aria-label="{% translate "explanation" %}">
<span>{% translate "Explanation" %}:</span>
{% blocktrans trimmed %}
Use this form for entering backup tokens for logging in.
These tokens have been generated for you to print and keep safe. Please
enter one of these backup tokens to login to your account.
{% endblocktrans %}
Use this form for entering backup tokens for logging in.
These tokens have been generated for you to print and keep safe. Please
enter one of these backup tokens to login to your account.
{% endblocktrans %}
</p>
{% endif %}
{% include "partials/form/form_errors.html" %}
Expand All @@ -53,9 +51,7 @@ <h1>{% translate "Login" %}</h1>
<button name="wizard_goto_step"
type="submit"
value="backup"
class="secondary">
{% translate "Use Backup Token" %}
</button>
class="secondary">{% translate "Use Backup Token" %}</button>
</p>
{% endif %}
{% include "two_factor/_wizard_actions.html" with step=wizard.steps.current %}
Expand Down
2 changes: 1 addition & 1 deletion rocky/fmea/templates/fmea/fmea_department_heatmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<td>{{ data.failure_mode }}</td>
{% for department in departments %}
{% if department in data.affected_departments %}
<td >
<td>
<span class="{{ data.risk_class.split|join:'-'|lower }}">{{ data.risk_class }}</span>
</td>
{% else %}
Expand Down
24 changes: 12 additions & 12 deletions rocky/fmea/templates/fmea/fmea_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
<h1>{% translate "FMEA introduction" %}</h1>
<p>
{% blocktranslate trimmed %}
FMEA (failure mode and effective analysis) is a step-by-step approach
for collecting knowledge about possible points of failure in a design,
manufacturing process, product or service.
{% endblocktranslate %}
FMEA (failure mode and effective analysis) is a step-by-step approach
for collecting knowledge about possible points of failure in a design,
manufacturing process, product or service.
{% endblocktranslate %}
</p>
<p>
{% blocktranslate trimmed %}
Failure mode (FM) refers to the way in which something might break
down and includes potential errors that may occur, especially errors
that may affect a system. Effective analysis (EA) involves
deciphering the consequences of those break downs by making sure
that all failures can be detected, determining how frequently a
failure might occur and identifying which potential failures should be
prioritized.
{% endblocktranslate %}
Failure mode (FM) refers to the way in which something might break
down and includes potential errors that may occur, especially errors
that may affect a system. Effective analysis (EA) involves
deciphering the consequences of those break downs by making sure
that all failures can be detected, determining how frequently a
failure might occur and identifying which potential failures should be
prioritized.
{% endblocktranslate %}
</p>
<div class="column-2">
<nav aria-label="document-navigation">
Expand Down
10 changes: 5 additions & 5 deletions rocky/katalogus/templates/change_clearance_level.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
role="group"
aria-label="{% translate "scan level warning" %}">
<strong>Warning:</strong>
{% blocktranslate trimmed with plugin_name=plugin.name scan_level=plugin.scan_level%}
{{plugin_name}} will only scan objects with a corresponding clearance level of <strong>L{{ scan_level }}</strong>
or higher.
{% blocktranslate trimmed with plugin_name=plugin.name scan_level=plugin.scan_level %}
{{ plugin_name }} will only scan objects with a corresponding clearance level of <strong>L{{ scan_level }}</strong>
or higher.
{% endblocktranslate %}
</p>
<section>
<div>
<h1>{% translate "Scan OOI" %}</h1>
<p class="emphasized">
{% blocktranslate trimmed with scan_level=plugin.scan_level%}
The following objects are not yet cleared for level {{scan_level}}, please be advised that by continuing you will declare a level {{scan_level}} on these objects.
{% blocktranslate trimmed with scan_level=plugin.scan_level %}
The following objects are not yet cleared for level {{ scan_level }}, please be advised that by continuing you will declare a level {{ scan_level }} on these objects.
{% endblocktranslate %}
</p>
<table>
Expand Down
3 changes: 1 addition & 2 deletions rocky/katalogus/templates/katalogus.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,5 @@ <h1>{% translate "KAT-alogus" %}</h1>
{% endblock content %}
{% block html_at_end_body %}
{{ block.super }}
<script src="{% static "/js/checkboxToggler.js" %}"
nonce="{{ request.csp_nonce }}"></script>
<script src="{% static "/js/checkboxToggler.js" %}" nonce="{{ request.csp_nonce }}"></script>
{% endblock html_at_end_body %}
12 changes: 6 additions & 6 deletions rocky/katalogus/templates/partials/objects_to_scan.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
<h2>{{ form_title }}</h2>
<p>
{% blocktranslate trimmed with scan_level=plugin.scan_level %}
This boefje will only scan objects with a corresponding clearance level of <strong>L{{ scan_level }}</strong>
or higher. There is no indemnification for this boefje to scan an OOI with a lower clearance level than <strong>L{{ scan_level }}</strong>. Use the filter to show OOI's with a lower clearance level.
{% endblocktranslate %}
This boefje will only scan objects with a corresponding clearance level of <strong>L{{ scan_level }}</strong>
or higher. There is no indemnification for this boefje to scan an OOI with a lower clearance level than <strong>L{{ scan_level }}</strong>. Use the filter to show OOI's with a lower clearance level.
{% endblocktranslate %}
</p>
<form method="get" class="inline">
<div class="horizontal-view">
{% include "partials/form/form_errors.html" with form=select_ooi_filter_form %}

{% for field in select_ooi_filter_form %}
<input type="{{ field.field.widget.input_type }}"
name="{{ field.name }}"
class="{{ field.field.widget.attrs.class }}"
{% if "show_all=on" in request.get_full_path %}checked{% endif %}/>
name="{{ field.name }}"
class="{{ field.field.widget.attrs.class }}"
{% if "show_all=on" in request.get_full_path %}checked{% endif %} />
<label>{{ field.label }}</label>
{% endfor %}
</div>
Expand Down
3 changes: 2 additions & 1 deletion rocky/katalogus/templates/partials/plugin_tile.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<div role="group" id="plugin_{{ plugin.id|slugify }}">
<img src="{% url "plugin_cover" organization_code=organization.code plugin_id=plugin.id %}"
alt="boefje placeholder image"/>
alt="boefje placeholder image" />
<div class="horizontal-view scan-intensity">
<span class="de-emphasized">{% translate "Scan level:" %}</span>
<ul class="level-indicator l{{ plugin.scan_level }}">
Expand All @@ -18,5 +18,6 @@
<a href="{% url "plugin_detail" organization_code=organization.code plugin_type=plugin.type plugin_id=plugin.id %}">{% translate "See details" %}</a>
<div class="action-buttons">
{% include "partials/enable_disable_plugin.html" with plugin=plugin %}

</div>
</div>
Loading

0 comments on commit 91e04b3

Please sign in to comment.