docs: add missing docstrings#82
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (4)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughRefactors filesystem handling to pathlib across core modules, makes two method arguments keyword-only, broadens Ruff linting with per-file ignores, removes a pip-audit CVE suppression, updates regex flag names, adjusts pytest fixtures, and expands/docstrings and copyright year ranges. No public API removals. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pyproject.toml`:
- Line 47: Ruff is reading ruff.toml first so the preview setting in
pyproject.toml is ignored; open ruff.toml and add preview = true under the
[lint] section (i.e., add or update the [lint] table to include preview = true)
so Ruff's preview rules are enabled instead of relying on preview = true in
pyproject.toml.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 51bf5f00-f0d9-4ac1-9d80-0d5d03aa7f18
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
flask_wiki/markdown_ext.pyflask_wiki/utils.pyflask_wiki/views.pypyproject.tomlscripts/test
💤 Files with no reviewable changes (1)
- scripts/test
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
flask_wiki/api.py (1)
392-407:⚠️ Potential issue | 🔴 CriticalBug:
delete_by_termreferences non-existent schema field.The schema (lines 413-419) defines fields
url,title,tags,body,language— there is nopathfield. This call silently fails to remove the document from the search index.🐛 Proposed fix
def delete(self, url): """Delete a page and remove it from the search index. :param str url: URL slug of the page to delete :returns: True if deleted, False if the page did not exist :rtype: bool """ path = self.path(url) if not self.exists(url): return False path.unlink() index_dir = index.open_dir(current_app.config.get("WIKI_INDEX_DIR")) writer = AsyncWriter(index_dir) - writer.delete_by_term("path", path) + writer.delete_by_term("url", url) writer.commit() return True🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flask_wiki/api.py` around lines 392 - 407, The delete method is calling writer.delete_by_term("path", path) but the search schema has no "path" field, so the document is never removed; update the call in delete(self, url) to delete by the correct indexed field ("url") and pass the URL slug (the url parameter as a string) rather than the Path object (path). Locate the delete method and replace the delete_by_term invocation to use ("url", url) so the index removal matches the schema and actually deletes the document from the search index.
🧹 Nitpick comments (1)
flask_wiki/api.py (1)
420-422: Minor: Redundant Path instantiation.
Path(index_dir)is instantiated twice on consecutive lines. Consider reusing a single variable.♻️ Suggested refactor
- if not Path(index_dir).exists(): - Path(index_dir).mkdir() + index_path = Path(index_dir) + if not index_path.exists(): + index_path.mkdir()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flask_wiki/api.py` around lines 420 - 422, Create a single Path instance for index_dir and reuse it instead of calling Path(index_dir) twice: assign Path(index_dir) to a variable (e.g., index_path), use index_path.exists() and index_path.mkdir() and then pass index_dir (or index_path) to index.create_in as appropriate; this eliminates redundant Path instantiation while preserving the existing behavior in the block that creates the index.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@flask_wiki/api.py`:
- Around line 392-407: The delete method is calling
writer.delete_by_term("path", path) but the search schema has no "path" field,
so the document is never removed; update the call in delete(self, url) to delete
by the correct indexed field ("url") and pass the URL slug (the url parameter as
a string) rather than the Path object (path). Locate the delete method and
replace the delete_by_term invocation to use ("url", url) so the index removal
matches the schema and actually deletes the document from the search index.
---
Nitpick comments:
In `@flask_wiki/api.py`:
- Around line 420-422: Create a single Path instance for index_dir and reuse it
instead of calling Path(index_dir) twice: assign Path(index_dir) to a variable
(e.g., index_path), use index_path.exists() and index_path.mkdir() and then pass
index_dir (or index_path) to index.create_in as appropriate; this eliminates
redundant Path instantiation while preserving the existing behavior in the block
that creates the index.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5e40f69f-c4e7-47ac-8bd9-f56e93eefac2
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (9)
flask_wiki/__init__.pyflask_wiki/api.pyflask_wiki/forms.pyflask_wiki/markdown_ext.pyflask_wiki/utils.pyflask_wiki/views.pypyproject.tomlscripts/testtests/conftest.py
💤 Files with no reviewable changes (1)
- scripts/test
✅ Files skipped from review due to trivial changes (5)
- tests/conftest.py
- flask_wiki/forms.py
- flask_wiki/utils.py
- flask_wiki/markdown_ext.py
- flask_wiki/init.py
🚧 Files skipped from review as they are similar to previous changes (1)
- pyproject.toml
- Add more ruff lint rules and fix linting errors. - Update pygments to 2.20.0 to fix CVE-2026-4539. Co-Authored-by: Pascal Repond <pascal.repond@rero.ch>
Uh oh!
There was an error while loading. Please reload this page.