Skip to content

fix: resolve 7 code quality issues and close test gaps - #18

Closed
codeasier wants to merge 1 commit into
mainfrom
fix/quality-improvements
Closed

codeasier wants to merge 1 commit into
mainfrom
fix/quality-improvements

Conversation

@codeasier

Copy link
Copy Markdown
Owner

📝 Description

Fix 7 code quality issues identified during code review and close test coverage gaps:

  1. Remove unused pydantic dependency — listed in pyproject.toml but never imported anywhere in the source
  2. Fix bool converter bug — "false" string was returning True (non-empty string truthiness); now uses x.lower() in ("true", "1", "yes") in both config.py and mapper.py
  3. Template loading no longer silently fails — replaced except Exception: pass with warnings.warn() in registry.py and executor.py
  4. Fix zip() strictness — changed strict=False to strict=True in executor.py to catch column count mismatches early
  5. Narrow exception handling in CLI — split broad except Exception in use command into specific DatabaseNotFoundError/SchemaVersionError + fallback
  6. Fix CLAUDE.md template naming — corrected *_v2 suffix to match actual filenames (e.g., leak_detection not leak_detection_v2)
  7. Close test gaps — added tests for bool converter variants, mapper KeyError propagation, and execute_on_all_devices

🔗 Related Issue

Fixes #12, #13, #14, #15, #16, #17

🧪 Testing

  • Tests added/updated — 198 tests passing (5 new tests added)
  • Manual testing completed

✅ Checklist

  • Code follows project guidelines
  • Documentation updated (CLAUDE.md template names corrected)
  • No new warnings introduced
  • Changes tested locally

📸 Screenshots (if applicable)

N/A — no UI changes

📋 Additional Notes

Issue Change Files
#15 (pydantic dead dep) Removed from dependencies pyproject.toml
#12 (bool converter) Fixed string → bool logic query/config.py, query/mapper.py
#13 (silent template load) Added warnings.warn() query/registry.py, query/executor.py
#16 (broad except + zip) Specific exceptions + strict=True cli.py, query/executor.py
#17 (test gaps) 5 new test cases tests/query/test_config.py, test_mapper.py, test_executor.py

Note: Issue #14 (QueryBuilder HAVING) is noted but not included in this PR as it requires new functionality rather than a bug fix — recommended as a follow-up PR.

- Remove unused pydantic dependency from pyproject.toml (#15)
- Fix bool converter bug: "false" string now returns False instead of True (#12)
- Replace silent pass with warnings in template loading (#13)
- Use strict=True in zip() to catch column count mismatches early (#16)
- Split broad except Exception in CLI use command (#16)
- Fix CLAUDE.md template naming mismatch
- Add test coverage for bool converter, mapper KeyError, execute_on_all_devices (#17)

Closes #12, #13, #14, #15, #16, #17
@codeasier codeasier closed this Apr 17, 2026
@codeasier
codeasier deleted the fix/quality-improvements branch April 17, 2026 12:57
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.

[BUG] bool 类型转换器 bug — bool("false") 返回 True

1 participant