Skip to content

Commit bc431da

Browse files
committed
lint: format files
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
1 parent b80cc7e commit bc431da

6 files changed

Lines changed: 452 additions & 511 deletions

File tree

.github/workflows/scripts/run-tests.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
$errors = $testHelper->errors;
1212
if (count($errors) > 0) {
13-
foreach($errors as $dir => $scriptErrors) {
13+
foreach ($errors as $dir => $scriptErrors) {
1414
print "Directory '$dir'\n";
1515

16-
foreach($scriptErrors as $error) {
16+
foreach ($scriptErrors as $error) {
1717
print " $error\n";
1818
}
1919
}
@@ -24,13 +24,15 @@
2424
print "No errors were found\n";
2525
exit(0);
2626

27-
class TestHelper {
27+
class TestHelper
28+
{
2829
public $errors = [];
2930

3031
/**
3132
* Tests the files in a directory
3233
*/
33-
public function testDirectory($dir) {
34+
public function testDirectory($dir)
35+
{
3436
$errors = [];
3537

3638
if (preg_match('/[^a-z0-9\-]/', $dir)) {
@@ -87,7 +89,7 @@ public function testDirectory($dir) {
8789
$errors[] = "'platforms' has to be an array!";
8890
} else {
8991
foreach ($data["platforms"] as $platform) {
90-
if (!in_array($platform, array("linux", "macos", "windows"))) {
92+
if (!in_array($platform, ["linux", "macos", "windows"])) {
9193
$errors[] = "Unsupported platform '$platform', only 'linux', 'macos' and 'windows' are allowed!";
9294
}
9395
}

ai-github-copilot-backend/ai-github-copilot-backend.qml

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ import QOwnNotesTypes 1.0
1515
*
1616
*/
1717
Script {
18-
property string githubToken;
18+
property string githubToken
1919

2020
property variant settingsVariables: [
2121
{
2222
"identifier": "githubToken",
2323
"name": "GitHub Personal Access Token",
2424
"description": "Enter your GitHub PAT (create at https://github.com/settings/tokens).\nFine-grained: enable 'Models: Read' permission.\nClassic: the 'models' scope is needed.",
2525
"type": "string-secret",
26-
"default": "",
26+
"default": ""
2727
}
28-
];
28+
]
2929

3030
function openAiBackendsHook() {
3131
if (!githubToken || githubToken === "") {
@@ -38,32 +38,7 @@ Script {
3838
"name": "GitHub",
3939
"baseUrl": "https://models.inference.ai.azure.com/chat/completions",
4040
"apiKey": githubToken,
41-
"models": [
42-
"gpt-4o",
43-
"gpt-4o-mini",
44-
"gpt-4.1",
45-
"gpt-4.1-mini",
46-
"gpt-4.1-nano",
47-
"gpt-5",
48-
"gpt-5-mini",
49-
"gpt-5-nano",
50-
"o4-mini",
51-
"o3",
52-
"o3-mini",
53-
"o1",
54-
"o1-mini",
55-
"deepseek-r1",
56-
"deepseek-r1-0528",
57-
"deepseek-v3-0324",
58-
"llama-4-scout-17b-16e-instruct",
59-
"llama-4-maverick-17b-128e-instruct-fp8",
60-
"llama-3.3-70b-instruct",
61-
"grok-3",
62-
"grok-3-mini",
63-
"mistral-small-2503",
64-
"phi-4",
65-
"phi-4-reasoning",
66-
],
41+
"models": ["gpt-4o", "gpt-4o-mini", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-5", "gpt-5-mini", "gpt-5-nano", "o4-mini", "o3", "o3-mini", "o1", "o1-mini", "deepseek-r1", "deepseek-r1-0528", "deepseek-v3-0324", "llama-4-scout-17b-16e-instruct", "llama-4-maverick-17b-128e-instruct-fp8", "llama-3.3-70b-instruct", "grok-3", "grok-3-mini", "mistral-small-2503", "phi-4", "phi-4-reasoning",]
6742
}
6843
];
6944
}

insert-moc/insert-moc.qml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,9 @@ Script {
2727
var relDir = noteObj.relativeNoteFileDirPath;
2828

2929
// Construct filePath and encoded path
30-
var filePath = relDir && relDir.length > 0
31-
? relDir + "/" + name + "." + ext
32-
: name + "." + ext;
33-
var rawLink = (relDir && relDir.length > 0
34-
? relDir + "/" + name
35-
: name);
36-
var encoded = encodeURIComponent(rawLink)
37-
.replace(/%2F/g, "/")
38-
.replace(/%2E/g, ".") + "." + ext;
30+
var filePath = relDir && relDir.length > 0 ? relDir + "/" + name + "." + ext : name + "." + ext;
31+
var rawLink = (relDir && relDir.length > 0 ? relDir + "/" + name : name);
32+
var encoded = encodeURIComponent(rawLink).replace(/%2F/g, "/").replace(/%2E/g, ".") + "." + ext;
3933

4034
// Format line
4135
var line = "|" + filePath + " | ---> [" + name + "." + ext + "](" + encoded + ")| ";
Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
{
2-
"name": "Link Importer and converter for Obsidian/Github/Pandoc/Markor and others",
3-
"identifier": "link-importer-and-converter-for-obsidian-github-pandoc-markor-and-others",
4-
"script": "link-importer-and-converter-for-obsidian-github-pandoc-markor-and-others.qml",
5-
"authors": [
6-
"@netlimpopo",
7-
"@gzgandalf"
8-
],
9-
"platforms": [
10-
"linux",
11-
"macos",
12-
"windows"
13-
],
14-
"version": "0.0.1",
15-
"minAppVersion": "26.1.5",
16-
"description": "<h2> Intro</h2><p>This script imports and exports links from other editors such as <strong>Obsidian/VS Code/Github/Markor/Pandoc</strong> into QOwnNotes and vice versa. It allows for quick switching between markdown editors. In Obsidian please use the plugin <a href='https://github.com/mnaoumov/obsidian-better-markdown-links'>Better markdown links</a> to first convert to standard markdown links instead of Wikilinks. Unfortunately markdown as a language is not as well defined as <i>orgmode</i> for instance. Especially heading Fragments and URL encoding of links differ quite significantly ([note](note.md#heading-fragment) vs. [note](note.md#Heading%20Fragment)). In practice, <strong>links to headings will break</strong> if one does not adapt the links to the specific needs of the editor. They might be readable by the editor, but renaming of notes / headings might break links silently, without you noticing.</p><h2>Usage</h2><p> Caution! Backup your data before you use this script as it might break all you links!</p><p>Simply copy files or folders into the QN Foldersystem. Then <strong>press the import/export button</strong> in the script menu, depending on which style you prefer. Done. For further info see <a href='https://github.com/pbek/QOwnNotes/issues/3225'>Ways to improve compatibility with other markdown editors</a>.</p>"
17-
18-
}
19-
1+
{
2+
"name": "Link Importer and converter for Obsidian/Github/Pandoc/Markor and others",
3+
"identifier": "link-importer-and-converter-for-obsidian-github-pandoc-markor-and-others",
4+
"script": "link-importer-and-converter-for-obsidian-github-pandoc-markor-and-others.qml",
5+
"authors": ["@netlimpopo", "@gzgandalf"],
6+
"platforms": ["linux", "macos", "windows"],
7+
"version": "0.0.1",
8+
"minAppVersion": "26.1.5",
9+
"description": "<h2> Intro</h2><p>This script imports and exports links from other editors such as <strong>Obsidian/VS Code/Github/Markor/Pandoc</strong> into QOwnNotes and vice versa. It allows for quick switching between markdown editors. In Obsidian please use the plugin <a href='https://github.com/mnaoumov/obsidian-better-markdown-links'>Better markdown links</a> to first convert to standard markdown links instead of Wikilinks. Unfortunately markdown as a language is not as well defined as <i>orgmode</i> for instance. Especially heading Fragments and URL encoding of links differ quite significantly ([note](note.md#heading-fragment) vs. [note](note.md#Heading%20Fragment)). In practice, <strong>links to headings will break</strong> if one does not adapt the links to the specific needs of the editor. They might be readable by the editor, but renaming of notes / headings might break links silently, without you noticing.</p><h2>Usage</h2><p> Caution! Backup your data before you use this script as it might break all you links!</p><p>Simply copy files or folders into the QN Foldersystem. Then <strong>press the import/export button</strong> in the script menu, depending on which style you prefer. Done. For further info see <a href='https://github.com/pbek/QOwnNotes/issues/3225'>Ways to improve compatibility with other markdown editors</a>.</p>"
10+
}

0 commit comments

Comments
 (0)