Skip to content

fix: resolve ruff lint errors in hermes and openharness adapters#1458

Merged
hijzy merged 1 commit intoMemTensor:mainfrom
hijzy:fix/ruff-lint-cleanup
Apr 10, 2026
Merged

fix: resolve ruff lint errors in hermes and openharness adapters#1458
hijzy merged 1 commit intoMemTensor:mainfrom
hijzy:fix/ruff-lint-cleanup

Conversation

@hijzy
Copy link
Copy Markdown
Collaborator

@hijzy hijzy commented Apr 10, 2026

Summary

  • Remove unused imports (os, Dict, List) and add contextlib where needed
  • Replace try-except-pass patterns with contextlib.suppress() for cleaner error suppression (SIM105)
  • Use list unpacking [*tsx.split(), str(candidate)] instead of concatenation (RUF005)
  • Use with open(...) context manager for file handling in daemon_manager.py (SIM115)
  • Add # noqa: E402 for intentional late imports after sys.path manipulation
  • Replace deprecated typing.Dict/typing.List with builtin dict/list (UP035)

All 20 remaining ruff lint errors resolved. ruff check apps/memos-local-plugin now passes cleanly.

Files Changed

  • adapters/hermes/__init__.py
  • adapters/hermes/bridge_client.py
  • adapters/hermes/config.py
  • adapters/hermes/daemon_manager.py
  • adapters/openharness/scripts/bridge_client.py
  • adapters/openharness/scripts/config.py
  • adapters/openharness/scripts/daemon_manager.py

Test Plan

  • ruff check apps/memos-local-plugin passes with no errors
  • Verify hermes adapter still loads and functions correctly
  • Verify openharness adapter still loads and functions correctly

- Remove unused imports (os, Dict, List) and add contextlib
- Replace try-except-pass with contextlib.suppress for cleaner error handling
- Use list unpacking [*tsx.split(), ...] instead of concatenation
- Use context manager (with open) for file handling in daemon_manager
- Add noqa: E402 for intentional late imports after sys.path manipulation
- Fix deprecated typing.Dict/List → builtin dict/list
@hijzy hijzy merged commit 77d0309 into MemTensor:main Apr 10, 2026
0 of 16 checks passed
hijzy added a commit that referenced this pull request Apr 10, 2026
…1459)

## Summary

- Apply `ruff format` auto-formatting to `capture.py` and `recall.py` in
openharness adapter scripts
- Adds missing blank lines between import groups and after module-level
statements
- Fixes dict literal indentation style in `capture.py`
- Removes unused `import os` in `recall.py`

Follow-up to #1458.

## Files Changed

- `adapters/openharness/scripts/capture.py`
- `adapters/openharness/scripts/recall.py`

## Test Plan

- [x] `ruff check apps/memos-local-plugin` passes
- [x] `ruff format --check apps/memos-local-plugin` passes
- [ ] Verify openharness capture/recall scripts still function correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant