Skip to content

Commit

Permalink
Enable and upgrade stylelint in pre-commit (#1388)
Browse files Browse the repository at this point in the history
Signed-off-by: ammar <[email protected]>
Co-authored-by: TwistMeister <[email protected]>
Co-authored-by: Heleen <[email protected]>
Co-authored-by: ammar <[email protected]>
Co-authored-by: Jan Klopper <[email protected]>
  • Loading branch information
5 people authored Aug 31, 2023
1 parent 2b7e4ac commit 2656aa1
Show file tree
Hide file tree
Showing 160 changed files with 773 additions and 2,983 deletions.
21 changes: 11 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ repos:
requirements-.*.txt$ |
retirejs.json$ |
^boefjes/boefjes/plugins/kat_fierce/lists |
^boefjes/tests/examples/inputs/cve-result-without-cvss.json |
^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/assets/css/themes/soft/fonts/tabler-icons/tabler-icons.scss$ |
^rocky/tests/stubs |
^docs/source/_static
)
Expand All @@ -104,15 +105,15 @@ repos:
- id: djlint-django
files: '^rocky/.*/templates/.*$'

# - repo: https://github.com/thibaudcolas/pre-commit-stylelint
# rev: v15.4.0
# hooks:
# - id: stylelint
# args: [--fix]
# additional_dependencies:
# - stylelint@15.4.0
# - stylelint-config-standard-scss@8.0.0
# files: "^(rocky\/assets\/src\/|docs\/source\/).*.(css|scss|sass)$"
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
rev: v15.10.1
hooks:
- id: stylelint
args: [ --fix ]
additional_dependencies:
- stylelint@15.10.1
- stylelint-config-standard-scss@10.0.0
files: "^(rocky\/assets\/css\/|docs\/source\/).*.(css|scss|sass)$"

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
Expand Down
5 changes: 4 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": "stylelint-config-standard-scss",
"ignoreFiles": ["rocky/assets/css/themes/soft/fonts/tabler-icons/tabler-icons.scss"],
"rules": {
"number-max-precision": 5,
"color-hex-length": "long",
Expand All @@ -8,7 +9,9 @@
true,
{
"ignoreFontFamilies": [
"RO Icons"
"RO Icons",
"tabler-icons",
"kat-icons"
]
}
]
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ down:
# Remove containers and all volumes (data loss!)
clean:
-docker-compose down --timeout 0 --volumes --remove-orphans
-rm -Rf rocky/node_modules rocky/assets/dist rocky/.parcel-cache

# Fetch the latest changes from the Git remote
fetch:
Expand Down
7 changes: 7 additions & 0 deletions boefjes/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ def test_correct_local_runner_hash(self) -> None:
# This boefje has a __pycache__ folder with *.pyc files, which should be ignored
boefje_resource_3 = local_repository.by_id("dummy_boefje_environment_with_pycache")

# Sanity check to make sure the .pyc files are actually there
path = Path(__file__).parent / "modules" / "dummy_boefje_environment_with_pycache"
assert Path(path / "some_subdir/cache.pyc").is_file()
assert Path(path / "some_subdir/__init__.py").is_file()
assert Path(path / "__pycache__/pytest__init__.cpython-311.pyc").is_file()
assert Path(path / "__pycache__/pytest_main.cpython-311.pyc").is_file()

assert boefje_resource_1.runnable_hash == "b07a0ecbb24e49843188a24e5298b9d614535c0ec1761e76366b6d8747515e7a"
assert boefje_resource_2.runnable_hash == "1d97b303499cc7ea79c4bb419a79bd5eea750c6430ddd759b7af22383e873a7e"
assert boefje_resource_3.runnable_hash == "67f956d89b2e2c5948f2090ac52eb752e2e65393df207180d8c24a6dea13b555"
2 changes: 1 addition & 1 deletion rocky/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.html
*.min.js
assets/dist/
assets/js/vendor/
assets/vendors/
14 changes: 14 additions & 0 deletions rocky/assets/css/abstracts/alert-colors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Alert colors

$grey: #cccccc;
$offwhite: #fafafa;
$lightgrey: #f0f0f0;
$pink: #ca005d;
$blue: #01689b;

:root {
--color-alert-informative: #006fb3;
--color-alert-warning: #7d6900;
--color-alert-positive: #157b31;
--color-alert-negative: #c3372c;
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
height: auto;
list-style: none;
}

margin: 0;
padding: 0;
position: static;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
0% {
transform: rotate(-10deg);
}

100% {
transform: rotate(10deg);
}
}

@keyframes paw {
0% {
transform: rotate(20deg);
}

100% {
transform: rotate(-40deg);
}
Expand All @@ -20,6 +23,7 @@
justify-content: center;
margin: 3rem auto;
}

.cat-loader {
height: 13rem;
position: relative;
Expand All @@ -31,13 +35,15 @@
position: absolute;
top: 8rem;
}

.ball {
animation: ball 1s alternate infinite ease-in-out;
left: 1.5rem;
position: absolute;
top: 9.5rem;
transform-origin: center bottom;
}

.head {
position: absolute;
top: 1rem;
Expand All @@ -50,20 +56,24 @@
top: 8rem;
transform-origin: center top;
}

.line {
left: 2rem;
position: absolute;
top: 11.5rem;
}

.body {
display: block;
position: absolute;
top: 4rem;
}

.ear-left {
left: 0.5rem;
position: absolute;
}

.ear-right {
left: 3rem;
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
opacity: 0.1;
}
}

.cat-paw-loader {
display: flex;
justify-content: flex-start;
Expand All @@ -17,15 +18,19 @@
&:nth-child(2) {
animation-delay: 250ms;
}

&:nth-child(3) {
animation-delay: 500ms;
}

&:nth-child(4) {
animation-delay: 750ms;
}

&:nth-child(5) {
animation-delay: 1000ms;
}

&:nth-child(6) {
animation-delay: 1250ms;
}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Dropdown listing */

.dropdown-list {
-webkit-box-shadow: var(--language-selector-list-box-shadow);
box-shadow: var(--language-selector-list-box-shadow);
border-radius: var(--language-selector-list-border-radius);
border-width: var(--language-selector-list-border-width);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
>ul {
padding: 0;
display: none;
background-color: #fff;
background-color: #ffffff;
list-style-type: disc;
margin-block-end: 0;
margin-block-start: 0;
Expand Down Expand Up @@ -60,7 +60,7 @@
}

&[aria-current="true"] {
a:before {
a::before {
content: "\ea5e";
font-family: var(--language-selector-list-button-icon-font-family);
margin-left: var(--language-selector-list-button-icon-margin-left);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.affected-objects {
span:not(:last-child) {
&:after {
&::after {
content: "-";
display: inline-block;
}
Expand Down
Loading

0 comments on commit 2656aa1

Please sign in to comment.