mirror of
https://github.com/banisterious/obsidian-custom-selected-word-count.git
synced 2026-07-22 05:49:07 +00:00
chore: post-audit consistency fixes
Two micro-fixes from a post-audit code review: 1. src/main.ts — route addExcludedHeading and addExcludedPhrase catch blocks through this.log(..., errorMessage(error)) to match the pattern every other catch in the file already uses. Pre-fix the diagnostic printed via console.error unconditionally; post-fix it prints only when the user has debug logging enabled. The user- facing Notice is unchanged either way. 2. .gitignore — drop *.html and *.zip rules. The *.html rule was redundant with the docs/ui-mockups/ directory rule that already catches every HTML file currently in the tree, and the *.zip rule was a Phase-0-era defense-in-depth concern the CI release pipeline made obsolete. Removing both means future intentional HTML or zip files won't be silently swallowed. CHANGELOG [Unreleased] entry covers both. All 134 vitest tests still pass; lint and build clean.
This commit is contained in:
parent
adbed06f8a
commit
c379bbd7a9
3 changed files with 7 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -48,8 +48,6 @@ CLAUDE.md
|
|||
|
||||
# UI mockups and temporary files
|
||||
docs/ui-mockups/
|
||||
*.html
|
||||
*.zip
|
||||
|
||||
# Obsidian developer documentation (external reference)
|
||||
obsidian-developer-docs/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Internal
|
||||
- **Consistency fixes flagged in post-audit review**
|
||||
- `addExcludedHeading` and `addExcludedPhrase` in `src/main.ts` routed their catch blocks through `console.error(...)`, while every other catch in the file uses `this.log(..., errorMessage(error))`. Updated the two outliers to match. Behavior change: the diagnostic message is now visible only when the user has debug logging enabled (the user-facing `Notice('Failed to add ...')` is unchanged). Pre-fix the message printed unconditionally; post-fix it's debug-gated like every other error path in the file.
|
||||
- Removed `*.html` and `*.zip` rules from `.gitignore`. The `*.html` rule was redundant with the `docs/ui-mockups/` directory rule that already catches every HTML file in the working tree; the `*.zip` rule was a Phase-0-era defense-in-depth concern that the CI release pipeline made obsolete (the pipeline produces no zips). Removing both means future intentional HTML or zip files won't be silently swallowed.
|
||||
|
||||
## [1.7.1] - 2026-05-13
|
||||
|
||||
### Internal
|
||||
|
|
|
|||
|
|
@ -751,7 +751,7 @@ export default class CustomSelectedWordCountPlugin extends Plugin {
|
|||
(this.app as AppWithInternals).setting.openTabById(this.manifest.id);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error adding excluded heading:', error);
|
||||
this.log('Error adding excluded heading:', errorMessage(error));
|
||||
new Notice('Failed to add heading to exclusion list');
|
||||
}
|
||||
}
|
||||
|
|
@ -787,7 +787,7 @@ export default class CustomSelectedWordCountPlugin extends Plugin {
|
|||
(this.app as AppWithInternals).setting.openTabById(this.manifest.id);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error adding excluded phrase:', error);
|
||||
this.log('Error adding excluded phrase:', errorMessage(error));
|
||||
new Notice('Failed to add phrase to exclusion list');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue