Skip to content

Commit 558a2ab

Browse files
committed
fix: Some issues that cause make precommit to fail
Signed-off-by: plotor <zhenchao.wang@hotmail.com>
1 parent 06d73e7 commit 558a2ab

File tree

15 files changed

+66
-51
lines changed

15 files changed

+66
-51
lines changed

.github/workflows/python-tests.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,17 @@ jobs:
8686
pip install dist/*.tar.gz
8787
pip uninstall -y memoryos
8888
89-
# Ruff checks
90-
- name: Install test group dependencies
89+
# Ruff and Pre-commit checks
90+
- name: Install test and dev group dependencies
9191
run: |
92-
poetry install --no-interaction --with test
92+
poetry install --no-interaction --with test --with dev
9393
- name: Ruff checks
9494
run: |
9595
poetry run ruff check
9696
poetry run ruff format --check
97+
- name: Pre-commit checks
98+
run: |
99+
poetry run pre-commit run -a
97100
98101
# PyTest checks
99102
- name: Install all extra dependencies

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ repos:
1212
- id: check-toml
1313
exclude: tests/fixtures/invalid_lock/poetry\.lock
1414
- id: check-yaml
15+
exclude: ^deploy/helm/templates/
1516
- id: pretty-format-json
1617
args: [--autofix, --no-ensure-ascii, --no-sort-keys]
1718
- id: check-ast

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ format:
3535
pre_commit:
3636
poetry run pre-commit run -a
3737

38+
# Alias for pre_commit
39+
precommit: pre_commit
40+
3841
serve:
3942
poetry run uvicorn memos.api.server_api:app
4043

apps/MemOS-Cloud-OpenClaw-Plugin/lib/check-update.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,30 +74,30 @@ function compareVersions(v1, v2) {
7474
const split2 = v2.split("-");
7575
const parts1 = split1[0].split(".").map(Number);
7676
const parts2 = split2[0].split(".").map(Number);
77-
77+
7878
// Compare major.minor.patch
7979
for (let i = 0; i < Math.max(parts1.length, parts2.length); i++) {
8080
const p1 = parts1[i] || 0;
8181
const p2 = parts2[i] || 0;
8282
if (p1 > p2) return 1;
8383
if (p1 < p2) return -1;
8484
}
85-
85+
8686
// If base versions are equal, compare pre-release tags.
8787
// A version WITH a pre-release tag is LOWER than a version WITHOUT one.
8888
// e.g. 0.1.8-beta is less than 0.1.8. 0.1.8 is the final release.
8989
const hasPre1 = split1.length > 1;
9090
const hasPre2 = split2.length > 1;
91-
91+
9292
if (hasPre1 && !hasPre2) return -1; // v1 is a beta, v2 is a full release
9393
if (!hasPre1 && hasPre2) return 1; // v1 is a full release, v2 is a beta
9494
if (!hasPre1 && !hasPre2) return 0; // both are full releases and equal
95-
95+
9696
// If both are pre-releases, do a basic string compare on the tag
9797
// "alpha" < "beta" < "rc"
9898
if (split1[1] > split2[1]) return 1;
9999
if (split1[1] < split2[1]) return -1;
100-
100+
101101
return 0;
102102
}
103103

apps/MemOS-Cloud-OpenClaw-Plugin/lib/config-ui/app.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const elements = {
5050
pathBox: document.getElementById("pathBox"),
5151
copyPathButton: document.getElementById("copyPathButton"),
5252
saveButton: document.getElementById("saveButton"),
53-
53+
5454
reloadButton: document.getElementById("reloadButton"),
5555
layout: document.getElementById("layout"),
5656
overlay: document.getElementById("overlay"),
@@ -340,7 +340,7 @@ function applyLanguageUi() {
340340
elements.copyPathButton.setAttribute("aria-label", uiText("copyPath"));
341341
elements.copyPathButton.setAttribute("title", uiText("copyPath"));
342342
elements.saveButton.textContent = uiText("save");
343-
343+
344344
elements.reloadButton.textContent = uiText("reload");
345345
elements.overlayTitle.textContent = uiText("overlayTitle");
346346
elements.overlayText.textContent = uiText("overlayText");
@@ -1037,15 +1037,15 @@ function renderForm() {
10371037
installSectionObserver(groups);
10381038

10391039
elements.saveButton.disabled = hasErrors || !isDirty();
1040-
1040+
10411041
elements.reloadButton.disabled = !remoteState;
10421042
refreshChrome();
10431043
}
10441044

10451045
function refreshChrome() {
10461046
const { errors } = collectDraft();
10471047
elements.saveButton.disabled = Object.keys(errors).length > 0 || !isDirty();
1048-
1048+
10491049
elements.reloadButton.disabled = !remoteState;
10501050
if (externalRefreshQueued) {
10511051
setBanner("warn", uiText("bannerExternal"));
@@ -1184,7 +1184,7 @@ async function loadRemote(initial = false) {
11841184
}
11851185
externalRefreshQueued = true;
11861186
refreshChrome();
1187-
1187+
11881188
}
11891189

11901190
refreshChrome();
@@ -1218,9 +1218,9 @@ async function saveConfig() {
12181218
remoteState = result.state;
12191219
draft = createDraftFromRemote(result.state);
12201220
baselineSnapshot = getDraftSnapshot();
1221-
1222-
1223-
1221+
1222+
1223+
12241224
externalRefreshQueued = false;
12251225
renderForm();
12261226
setOverlay(false, "", "");

apps/MemOS-Cloud-OpenClaw-Plugin/lib/config-ui/icon.svg

Lines changed: 1 addition & 1 deletion
Loading

apps/MemOS-Cloud-OpenClaw-Plugin/scripts/sync-version.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ const filesToUpdate = [
2020

2121
filesToUpdate.forEach(fileName => {
2222
const filePath = path.resolve(__dirname, '..', fileName);
23-
23+
2424
if (fs.existsSync(filePath)) {
2525
try {
2626
const content = JSON.parse(fs.readFileSync(filePath, 'utf8'));
27-
27+
2828
if (content.version !== newVersion) {
2929
content.version = newVersion;
3030
// Write back with 2 spaces indentation and a newline at the end

apps/MemOS-Cloud-OpenClaw-Plugin/test/query-strip.test.mjs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,16 @@ test("supports leading blank lines before inbound metadata", () => {
162162
});
163163

164164
test("strips Feishu injected prompt", () => {
165-
const input = `System: [2026-03-17 14:17:33 GMT+8] Feishu[default] DM from ou_37e8a1514c24e8afd9cfeca86f679980: 我叫什么名字
166-
167-
Conversation info (untrusted metadata):
168-
\`\`\`json
169-
{
170-
"timestamp": "Tue 2026-03-17 14:17 GMT+8"
171-
}
172-
\`\`\`
173-
174-
[message_id: om_x100b54bb510590dcc2998da17ca2c2b]
165+
const input = `System: [2026-03-17 14:17:33 GMT+8] Feishu[default] DM from ou_37e8a1514c24e8afd9cfeca86f679980: 我叫什么名字
166+
167+
Conversation info (untrusted metadata):
168+
\`\`\`json
169+
{
170+
"timestamp": "Tue 2026-03-17 14:17 GMT+8"
171+
}
172+
\`\`\`
173+
174+
[message_id: om_x100b54bb510590dcc2998da17ca2c2b]
175175
ou_37e8a1514c24e8afd9cfeca86f679980: 我叫什么名字 `;
176176

177177
assert.equal(stripOpenClawInjectedPrefix(input), "我叫什么名字");
@@ -191,7 +191,7 @@ ou_real: actual message`;
191191

192192
test("strips Feishu prompt without system header", () => {
193193
const input = `
194-
[message_id: om_x100b54bb510590dcc2998da17ca2c2b]
194+
[message_id: om_x100b54bb510590dcc2998da17ca2c2b]
195195
ou_37e8a1514c24e8afd9cfeca86f679980: 我叫什么名字 `;
196196
assert.equal(stripOpenClawInjectedPrefix(input), "我叫什么名字");
197197
});

apps/memos-local-openclaw/openclaw.plugin.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,7 @@
3333
"If better-sqlite3 fails to build, ensure you have C++ build tools: xcode-select --install (macOS) or build-essential (Linux)"
3434
]
3535
},
36-
"extensions": ["./index.ts"]
36+
"extensions": [
37+
"./index.ts"
38+
]
3739
}

apps/memos-local-openclaw/skill/browserwing-executor/SKILL.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,4 +507,3 @@ All operations return:
507507
"detail": "Detailed error message"
508508
}
509509
```
510-

0 commit comments

Comments
 (0)