Repository navigation
feat: leave out citry check findings in registered library components - #402
Merged
Merged
Conversation
An app that registers Citry UI got about 1,500 citry check errors from Citry UI's own components, which the app's author cannot change, so the check failed on every such app and the app's own findings were lost in the noise. citry check now leaves out findings whose components all come from libraries installed with register_library(), from both the registry check and --types, and prints one note with how many it left out and which libraries they came from. The exit status counts only the findings it reports. --include-libraries, or LintSettings.include_libraries=True, reports them too; Citry UI's own tests pass the flag. A finding that any app component shares is still reported, such as one in a template or js_data() that a subclass of a library component inherits. A minimal app that registers Citry UI now checks clean. Fixes #149 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #149.
What changes
An app that registers Citry UI used to get about 1,500
citry checkerrors from Citry UI's own components. The app's author can't change that code, so the check failed on every such app and hid the app's own findings. As the maintainer decided in #149,citry checknow leaves out findings in the components of a registered library by default:register_library(). This applies to the registry check and to--types. Code that two libraries share, such as a theme library built on Citry UI, is left out and counted once.js_data(), JavaScript or CSS that an app's subclass of a library component inherits. For the maintainer: that means an app that subclasses a Citry UI component gets back the inherited template's findings. The docs say so. Tell me if you'd rather leave those out too.citry check: note: left out 1505 findings in components from the registered library 'citry-ui'; pass --include-libraries to report themThe note is also in the JSON report's
notes. The JSON schema is unchanged.--include-libraries, orLintSettings(include_libraries=True), reports them too. A non-bool setting raisesTypeErrorwhen the settings are created.--include-libraries:test_component_javascript_names.pyandtest_citry_ui_type_check.py.How a finding is traced to its components: the checker already names each finding's place as text. That is a component's import path with an attribute, a file path with a component in brackets, a file path with a line and column, or
<file>::<Class>.messages._LibraryOwnerstraces it in this order:A finding that it can't trace to any component, such as
i18n catalogor a catalog package'spackage:pathmessages file, is kept. Known limit: a--typesfinding in an inline template that an app subclass inherits from a library inside the workspace is placed in the library's file, so it is left out.--typesalready skips installed packages.Docs
docs_site/content/advanced/cli.md(#check-library-components).LintSettings.include_librariesdocstring.citry checkcommand docstring.Tests
packages/py/citry/tests/test_check_libraries.py, new:--include-libraries --format jsonreports them.packages/py/citry_ui/tests/test_citry_ui_registration.py::test_an_app_that_only_registers_citry_ui_checks_clean: the guard the issue asked for. A minimal app that registers Citry UI checks with zero findings, exit status 0, and the note. It uses the existing in-process check, so it adds no extra run.js_data()code stays the app's, and code two libraries share is left out once. Both fail without the fix.Evidence (local)
-m "not e2e"): 9,771 passed. One failure is local only:test_citry_ui_type_check.py::test_the_editor_accepts_digit_inputs_as_text_or_numbersgets no ty findings in my environment. It fails the same way on my main checkout and passes in CI.LintSettingsfields (ide/template-linting.md) and how a library checks itself (advanced/component-libraries.md).test_extract_first_party_security_errorfails only in my scratch worktree, because the installedcitry_corecomes from a different checkout. It passes in the main checkout.--platform linux), the protocol phases and the validators pass.PR CI runs the cargo phases and the full matrix.
A follow-up PR will propose a check-only way for a component to declare its template-data keys, so the checker can verify Citry UI's own templates with the flag on. That adds a public option, so the proposal comes first.
🤖 Generated with Claude Code