-
-
Notifications
You must be signed in to change notification settings - Fork 25
feat: Make Wordbook fully offline #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Remove flatpak-builder-tools - Added a custom script to update deps - Update deps across the board - Improved type hints - Other minor changes
- Add packaging info - Fix word buttons not searching - Remove explicit "version" params
|
|
||
| # WordNet database version information | ||
| WN_DB_VERSION: str = "oewn:2024" | ||
| WN_FILE_VERSION: str = f"oewn-2024-{WN_LIB_VERSION}" |
Check notice
Code scanning / CodeQL
Unused global variable Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 days ago
To fix an unused global variable while keeping behavior unchanged, you either (1) remove the variable assignment if its value is genuinely unneeded and the right-hand side has no side effects, or (2) if it is intentionally present (for documentation, future use, or clarity), rename it to follow a convention that clearly marks it as intentionally unused (e.g., prefix with unused_). Here, WN_FILE_VERSION has no side-effecting right-hand side and there is no evidence of use within this file. Removing the assignment could break external code if it exists, so the least disruptive fix is to keep the assignment but rename the variable to an "unused" name that static analysis tools recognize.
Concretely, in wordbook/constants.py, change line 22 from:
WN_FILE_VERSION: str = f"oewn-2024-{WN_LIB_VERSION}"to something like:
_unused_WN_FILE_VERSION: str = f"oewn-2024-{WN_LIB_VERSION}"This preserves the computation and assignment (in case some reflection-based code inspects module globals) while clearly indicating the variable is intentionally unused and satisfying the static analysis rule.
No new methods or imports are needed; only this single variable name change is required within the shown snippet.
-
Copy modified line R22
| @@ -19,7 +19,7 @@ | ||
|
|
||
| # WordNet database version information | ||
| WN_DB_VERSION: str = "oewn:2024" | ||
| WN_FILE_VERSION: str = f"oewn-2024-{WN_LIB_VERSION}" | ||
| _unused_WN_FILE_VERSION: str = f"oewn-2024-{WN_LIB_VERSION}" | ||
|
|
||
| # Part of speech mapping from WordNet codes to human-readable names | ||
| POS_MAP: dict[str, str] = { |
Would fix #35