Skip to content

Commit 6d3786c

Browse files
authored
refactor: fix semantic linebreaks (#46)
Enforce semantic linebreaks and fix all occurrences. Add SARIF formatter and use sarif-upload action to show them in the PR.
1 parent a14ddb8 commit 6d3786c

17 files changed

+87
-15
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2yaml
2+
3+
# additional configuration to the config in the root of the project
4+
# this additional config is used during the markdownlint CI job
5+
6+
# use custom rule contained in supplementary rules image as a workaround
7+
# more details: https://github.com/DavidAnson/vscode-markdownlint/issues/336
8+
customRules:
9+
# Enforce one sentence per line
10+
# semantic line breaks (https://sembr.org/)
11+
# See: https://github.com/DavidAnson/markdownlint/pull/719
12+
- "markdownlint-rule-max-one-sentence-per-line"
13+
14+
outputFormatters:
15+
- - markdownlint-cli2-formatter-pretty
16+
- - markdownlint-cli2-formatter-sarif

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,25 @@ jobs:
2929
run: uv lock --locked
3030
- name: Run pre-commit
3131
uses: pre-commit/[email protected]
32+
- name: Run markdownlint
33+
uses: YannickTeKulve/[email protected]
34+
with:
35+
image: davidanson/markdownlint-cli2-rules:v0.14.0
36+
# node user does not have permissions to workspace due to user id mismatch
37+
options: -v ${{ github.workspace }}:/workdir --user root
38+
# don't fail step if there are violations
39+
run: markdownlint-cli2 --config .github/markdownlint/.markdownlint-cli2.yaml "**/*.md" || true
40+
- name: Upload SARIF file
41+
uses: github/codeql-action/upload-sarif@v3
42+
with:
43+
# Path to SARIF file relative to the root of the repository
44+
sarif_file: markdownlint-cli2-sarif.sarif
45+
# Optional category for the results
46+
# Used to differentiate multiple results for one commit
47+
category: markdownlint
48+
# fail if there are markdownlint violations
49+
- name: Check markdownlint results
50+
run: |
51+
cat markdownlint-cli2-sarif.sarif | grep -q '"results": \[\]'
3252
- name: Build mkdocs site
3353
run: uv run mkdocs build --strict

.markdownlint.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,17 @@ MD034: false
1919
# See: https://facelessuser.github.io/pymdown-extensions/extensions/tabbed/
2020
# See: https://squidfunk.github.io/mkdocs-material/reference/admonitions/
2121
MD046: false
22+
23+
max-one-sentence-per-line:
24+
# ignore admonition syntax
25+
# see: https://github.com/aepfli/markdownlint-rule-max-one-sentence-per-line/pull/52/files#r1579994724
26+
ignored_words:
27+
- "ie"
28+
- "i.e"
29+
- "eg"
30+
- "e.g"
31+
- "etc"
32+
- "ex"
33+
- "!!"
34+
- "??"
35+
- "vs"

docs/blog/posts/2012/hide-star-besides-email-addresses-in-thunderbird.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ slug: hide-star-besides-email-addresses-in-thunderbird
1212

1313
If you—for some reason—don't like the yellow (for contacts in your address book) or gray (for unknown contacts) star next to email addresses in the message header there's a simple way on how to hide it.
1414

15-
If you don't have one yet, all it needs is a file called [userChrome.css](https://web.archive.org/web/20130728221756/https://developer.mozilla.org/en-US/docs/Thunderbird/Thunderbird_Configuration_Files#userChrome.css) inside a folder called `chrome` inside your profile folder. Add the following content:
15+
If you don't have one yet, all it needs is a file called [userChrome.css](https://web.archive.org/web/20130728221756/https://developer.mozilla.org/en-US/docs/Thunderbird/Thunderbird_Configuration_Files#userChrome.css) inside a folder called `chrome` inside your profile folder.
16+
Add the following content:
1617

1718
```css
1819
.emailStar {

docs/blog/posts/2013/reducing-file-size-of-a-pdf-on-mac-os.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Instead of sending large files, it is almost always recommended to reduce the fi
1515
To do that, there are several ways.
1616
For example, there is an app called [_PDF Squeezer_](https://apps.apple.com/de/app/pdf-squeezer-4/id1502111349?l=en-GB&mt=12 "PDF Squeezer") in the _Mac App Store_ (in 2013: €3.59 or $3.99, more expensive today).
1717

18-
The same functionality can be achieved using _Quartz filters_ in the _ColorSync Utility_. There is already one called _Reduce File Size_ but it might lead to a blurry PDF.
18+
The same functionality can be achieved using _Quartz filters_ in the _ColorSync Utility_.
19+
There is already one called _Reduce File Size_ but it might lead to a blurry PDF.
1920
You can copy this filter and adjust the settings.
2021
However, I found custom filters in the [Apple Support Community](https://discussions.apple.com/message/21402148#21402148 "Apple Support Community") that work quite well.
2122

docs/blog/posts/2015/thunderbird-extension-toggle-headers-updated.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ Generally, I prefer to be contacted directly with bug reports and be able to res
2020
If a developer doesn't respond, a bad review is then acceptable.
2121
However, in this case bad reviews could be turned into very good ones, so no complaints in the end :smile:.
2222

23-
Long story short, a new version of Toggle Headers was released. Basically, [Toggle Headers v1.0](https://addons.thunderbird.net/thunderbird/addon/toggle-headers/) restores support for _CompactHeader 2.1.0_ and higher, but at the same time, it still works with older versions. Unfortunately, the new version of _CompactHeader_ contains a bug that prevents toggling between the header modes (_Normal_/_All_) to work properly. I [reported the bug](https://forums.mozillazine.org/viewtopic.php?p=14375693#p14375693) in the referenced support forums, but haven't received a response to date.
23+
Long story short, a new version of Toggle Headers was released.
24+
Basically, [Toggle Headers v1.0](https://addons.thunderbird.net/thunderbird/addon/toggle-headers/) restores support for _CompactHeader 2.1.0_ and higher, but at the same time, it still works with older versions.
25+
Unfortunately, the new version of _CompactHeader_ contains a bug that prevents toggling between the header modes (_Normal_/_All_) to work properly.
26+
I [reported the bug](https://forums.mozillazine.org/viewtopic.php?p=14375693#p14375693) in the referenced support forums, but haven't received a response to date.
2427

2528
This required a workaround to be integrated into the new version.
2629
When switching from collapsed header pane and _Normal_ to _All_ headers and then back to _Normal_, the header pane would stay expanded.

docs/blog/posts/2016/firefox-close-tab-button-on-hover.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Place this file into the `chrome` folder inside your profile's directory.
4949
Follow the [directions from Mozilla to find out where to find the profile's directory location](https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data).
5050
If the `chrome` folder does not exist, you need to create it first.
5151

52+
<!-- markdownlint-disable-next-line max-one-sentence-per-line -->
5253
>? NOTE: **Additional step for Firefox before `v113` only**
5354
> In the address bar, open `about:config` and change the following preferences:
5455
> `browser.tabs.tabClipWidth` to `99`

docs/blog/posts/2018/digging-into-the-firefox-ui-for-the-tab-close-button.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ slug: digging-into-the-firefox-ui-for-the-tab-close-button
99
---
1010
# Digging into the Firefox UI for the tab close button
1111

12-
Oops ... last year a new Firefox version broke the ["close button on tab hover" tweak](../2016/firefox-close-tab-button-on-hover.md) and I mentioned I will write a separate blog post on how I found out why and how to fix it.
12+
Last year a new Firefox version broke the ["close button on tab hover" tweak](../2016/firefox-close-tab-button-on-hover.md) and I mentioned I will write a separate blog post on how I found out why and how to fix it.
1313
Life happened, but fortunately I wrote down bullet points about what I did.
1414

1515
It seems that with Firefox 54 something in the UI changed which broke the functionality.

docs/blog/posts/2020/migrating-data-to-nextcloud.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ Even then, you can use the same procedure I used.
2525

2626
## Copy data to external drive
2727

28-
For the external drive, I formatted it as _ExFat_ so that my Mac can write to it. On the Raspberry Pi, I had to install `exfat-fuse`.
28+
For the external drive, I formatted it as _ExFat_ so that my Mac can write to it.
29+
On the Raspberry Pi, I had to install `exfat-fuse`.
2930
I tried _FAT32_ as it is supported out-of-the-box by both but it has a limitation on maximum file size.
3031
I considered using _ext4_ but write support on the Mac supposedly is not stable.
3132

docs/blog/posts/2020/notes-on-docker.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ networks:
8686
## Running the database on the host
8787
8888
As outlined previously, I have a [_MariaDB_ instance running on the host](./notes-on-setting-up-my-raspberry-pi.md).
89-
Why is it not running in a container? I did consider it but containers are supposed to be stateless and the [general recommendation is to not run production databases in Docker](https://vsupalov.com/database-in-docker/).
89+
Why is it not running in a container?
90+
I did consider it but containers are supposed to be stateless and the [general recommendation is to not run production databases in Docker](https://vsupalov.com/database-in-docker/).
9091
There is an interesting discussion about this on [Reddit](https://www.reddit.com/r/docker/comments/amo2cc/running_production_databases_in_docker/) as well.
9192
In the end, it seemed like a risk (which I am not willing to take).
9293
@@ -103,7 +104,8 @@ _MariaDB_ is then bound to the host IP of that network.
103104
A disadvantage is that then only Docker containers within that network can access the database.
104105
So if you have any other application on the host that needs to access the database that doesn't work.
105106

106-
When creating database users, instead of specifying `'user'@'localhost'` you could say `'user'@'172.22.0.%'`. This assumes that your subnet is `172.22.0.0/24`.
107+
When creating database users, instead of specifying `'user'@'localhost'` you could say `'user'@'172.22.0.%'`.
108+
This assumes that your subnet is `172.22.0.0/24`.
107109
This way you don't need to know the specific IP address of a container.
108110
Also, the IP address of a container is not guaranteed to be the same if you restart your containers.
109111
To create a database with a user do the following in the SQL console (when running `sudo mysql` from the host):
@@ -118,7 +120,8 @@ FLUSH PRIVILEGES;
118120

119121
If ever you perform a `docker logs <containername>` you most likely will notice that the timezone does not match your host's timezone (unless you happen to live in the _GMT_ timezone :smile:).
120122
By default, [Docker syncs the time but not timezone](https://stackoverflow.com/q/22800624), so the timezone is `GMT`/`UTC`.
121-
Some images do support the [setting of an environment variable](https://github.com/docker-library/redis/issues/127) `TZ` specifying the timezone but it is not always the case. If you want to support this for your own image, you need to install the `tzdata` system package.
123+
Some images do support the [setting of an environment variable](https://github.com/docker-library/redis/issues/127) `TZ` specifying the timezone but it is not always the case.
124+
If you want to support this for your own image, you need to install the `tzdata` system package.
122125
However, you can also simply add a bind mount to your volumes:
123126

124127
```yaml

0 commit comments

Comments
 (0)