tests.test_lint_repo module¶
Tests for the repository lint package.
- tests.test_lint_repo.test_repo_object_is_read_once()[source]¶
One
GET /repos/{repo}serves every check reading the repository object.
- tests.test_lint_repo.test_repo_object_is_none_when_it_cannot_be_read(repo, payload)[source]¶
No repository, or an unreadable answer, reads as an absent object.
- tests.test_lint_repo.test_slug_refuses_a_context_without_a_repository()[source]¶
A check reading the API through an ungated context fails loudly.
- tests.test_lint_repo.test_rulesets_are_read_once()[source]¶
The two ruleset checks share one read of the rulesets API.
- tests.test_lint_repo.test_sphinx_with_website()[source]¶
No warning when Sphinx project has website.
- tests.test_lint_repo.test_sphinx_without_website(homepage)[source]¶
Warning when Sphinx project has no website, whatever GitHub stores for none.
- tests.test_lint_repo.test_sphinx_website_unreadable_repository()[source]¶
An unreadable repository object skips, rather than reporting no website.
- tests.test_lint_repo.test_documentation_url(project_urls, expected)[source]¶
Resolve the documentation site a project declares in
[project.urls].
- tests.test_lint_repo.test_sphinx_website_matches_docs_url(homepage_url, docs_url)[source]¶
Pass when the website field and the declared docs URL name one address.
- tests.test_lint_repo.test_sphinx_website_differs_from_docs_url(homepage_url, docs_url)[source]¶
Fail when the website field names something other than the docs URL.
- tests.test_lint_repo.test_sphinx_website_without_declared_docs_url()[source]¶
Keep the presence-only check when the project declares no docs URL.
- tests.test_lint_repo.test_descriptions_differ(description)[source]¶
Error when descriptions differ, an empty repository description included.
- tests.test_lint_repo.test_description_unreadable_repository()[source]¶
An unreadable repository object skips, never fails a fatal check.
- tests.test_lint_repo.test_repository_object_checks_need_a_repository(name)[source]¶
A check reading the repository object never runs without a repository.
Without the gate, the description check would compare the project’s description against nothing and fail, fatally, on every local run naming no repository.
- tests.test_lint_repo.test_all_checks_pass()[source]¶
No check fails the run when the repository matches the project.
- tests.test_lint_repo.test_package_name_warning()[source]¶
A package name mismatch warns, and the run still passes.
- tests.test_lint_repo.test_website_warning()[source]¶
A missing website warns, and the run still passes.
- tests.test_lint_repo.test_website_docs_url_mismatch_warning()[source]¶
A website field pointing away from the docs URL warns without failing.
- tests.test_lint_repo.test_notifications_pat_check(unsubscribe_active, has_notifications_pat, expected)[source]¶
The notifications PAT check only fires when the workflow is opted in.
- tests.test_lint_repo.test_virustotal_secret_check(nuitka_active, has_virustotal_key, expected)[source]¶
The VirusTotal key check only fires when Nuitka compiles release binaries.
- tests.test_lint_repo.test_cloudflare_secrets_check(site_deploy, is_sphinx, has_token, expected)[source]¶
The token is the whole of the credential.
The account is derived from it at run time: a token scoped to nothing but
Cloudflare Pages: Editstill enumerates the account it belongs to, so no second identifier is asked for or reported on.
- tests.test_lint_repo.test_cloudflare_r2_secrets_follow_the_declared_bucket(bucket, applies)[source]¶
Without a bucket the deploy drops oversized files by design, reading no key.
- tests.test_lint_repo.test_oversized_site_files(tmp_path, big, bucket, passed, fragment)[source]¶
Warn about a tracked file the Pages deploy would drop, unless R2 takes it.
- tests.test_lint_repo.test_pages_deployment_source_follows_the_deploy_target(site_deploy, probed)[source]¶
The Pages source check is skipped for a project that deploys elsewhere.
GET /repos/{repo}/pagesanswers404for a repository that never enabled Pages, which the check reads as indeterminate. Reported against a Cloudflare-hosted project that is a permanent skip line about a setting nobody will ever change.
- tests.test_lint_repo.test_pages_redirect_preserved(pages, history, docs_url, passed, fragment)[source]¶
The old
github.iospace must keep redirecting after a move.Disabling Pages is the unrecoverable mistake: it deletes the redirect and every historical link with it, silently, because nothing inside the repository changes. Leaving the custom domain unset is the quieter one, where the old host serves a copy that stops being rebuilt the moment the deploy job is gated off.
- tests.test_lint_repo.test_pages_redirect_check_follows_the_deploy_target()[source]¶
Only a repository that moved away is asked to keep redirecting.
- tests.test_lint_repo.MANPAGES_CONTEXT = LintContext(config=Config(abandoned_versions=[], action_pins_sync=True, awesome_template_sync=True, binaries_sync=True, bumpversion_sync=True, cache=CacheConfig(dir='', github_releases_ttl=86400, max_age=30, npm_ttl=86400, pypi_ttl=86400), changelog_archive_location='', changelog_bullet_word_threshold=40, changelog_location='./changelog.md', debug_sync=False, dep_sources_sync=True, dependency_graph=DependencyGraphConfig(all_extras=True, all_groups=True, level=None, no_extras=[], no_groups=[], output='./docs/assets/dependencies.mmd', update=True), dev_release_sync=True, docs=DocsConfig(apidoc_exclude=[], apidoc_extra_args=[], update_script='./docs/docs_update.py'), exclude=[], github_releases_sync=True, gitignore=GitignoreConfig(extra_categories=[], extra_content='# Claude Code local files.\n.claude/scheduled_tasks.lock\n.claude/settings.local.json\n**/.claude/.cc-writes/\n\n# Agent skill scripts, which the virtualenv `[Ss]cripts` rule ignores.\n!**/skills/*/scripts/\n\n# Cloudflare wrangler local state.\n.wrangler/\n\n# Sphinx linkcheck output.\ndocs/_linkcheck/', location='./.gitignore', sync=True), include=[], labels=LabelsConfig(content_rules={}, extra=[], extra_files=[], file_rules={}, sync=True), lint_deps=LintDepsConfig(allow={}, comment_word_threshold=40), lint_repo=LintRepoConfig(declined={}), mailmap_sync=True, manpages_asset_name='', manpages_script='basket.cli:basket', metrics=MetricsConfig(charts=[], colors={}, forges={}, predecessors={}, store='./docs/assets/metrics.csv', subjects={}, sync=False), minimum_release_age='1 week', notification_max_unsubscribes=200, notification_months=3, notification_unsubscribe=False, nuitka_dev_targets=['linux-arm64'], nuitka_enabled=True, nuitka_entry_points=[], nuitka_extras=[], nuitka_nofollow_imports=['tkinter'], nuitka_unstable_targets=[], pypi_package_history=[], release_assets=[], settings_location='./.claude/settings.json', setup_guide=True, site_cloudflare_compatibility_date='', site_cloudflare_placement='', site_cloudflare_project='', site_cloudflare_r2_bucket='', site_cloudflare_r2_domain='', site_deploy='github-pages', skills_location='./.claude/skills/', sphinx_builder='html', sphinx_fail_on_warning=False, subagents_location='./.claude/agents/', sync_runner_images=SyncRunnerImagesConfig(ignore=[], sync=True), test_matrix=TestMatrixConfig(exclude=[], full_include=[], include=[], remove={}, replace={}, unstable=[], variations={}), tool_versions_sync=True, upstream_pin_sync=True, uv_lock_sync=True, vulnerable_deps=VulnerableDepsConfig(sources=['uv-audit', 'github-advisories'], sync=True), workflow=WorkflowConfig(source_paths=None, extra_paths=[], ignore_paths=[], paths={}, sync=True), workflow_pins_ignore=[], workflow_pins_sync=True), repo=None, repo_name=None, package_name=None, is_package=False, is_sphinx=False, uses_myst=False, has_changelog=False, project_description=None, docs_url=None, keywords=None, tool_table={}, nuitka_active=False, has_pat=False, has_virustotal_key=False, has_cloudflare_api_token=False, has_cloudflare_r2_keys=False, has_notifications_pat=False)¶
A project opting into man pages, whose lockfile each test writes.
- tests.test_lint_repo.test_manpages_toolchain_reads_the_locked_click_extra(tmp_path, monkeypatch, version, passed)[source]¶
The floor is checked against
uv.lock, which the job installs from.
- tests.test_lint_repo.test_manpages_toolchain_matches_a_non_canonical_lock_name(tmp_path, monkeypatch)[source]¶
A lock spelling the package
Click_Extranames the same project.
- tests.test_lint_repo.test_manpages_toolchain_is_indeterminate_without_click_extra(tmp_path, monkeypatch, packages)[source]¶
A lock that never mentions click-extra answers neither pass nor fail.
- tests.test_lint_repo.test_manpages_toolchain_is_indeterminate_without_a_lock(tmp_path, monkeypatch)[source]¶
A project with no lockfile is reported as unknown, not broken.
- tests.test_lint_repo.test_manpages_toolchain_only_applies_to_an_opted_in_project()[source]¶
The roster entry stays silent until
manpages.scriptis set.
- tests.test_lint_repo.BOOTSTRAP_CONFIGS = (ToolConfigComponent(name='ruff', description='Ruff linter/formatter configuration', init_default=<InitDefault.EXPLICIT: 3>, scope=<RepoScope.ALL: 1>, files=(), config_key='', ephemeral=False, location_field='', source_file='ruff.toml', tool_section='tool.ruff', sync_mode=<SyncMode.BOOTSTRAP: 1>, customizable_entries=(), legacy_table='', preserved_keys=(), graft_identity_keys=(), overlay=False), ToolConfigComponent(name='pytest', description='Pytest test configuration', init_default=<InitDefault.EXPLICIT: 3>, scope=<RepoScope.ALL: 1>, files=(), config_key='', ephemeral=False, location_field='', source_file='pytest.toml', tool_section='tool.pytest', sync_mode=<SyncMode.BOOTSTRAP: 1>, customizable_entries=(('addopts', '--cov=.'),), legacy_table='ini_options', preserved_keys=(), graft_identity_keys=(), overlay=False), ToolConfigComponent(name='coverage', description='Coverage.py measurement and reporting configuration', init_default=<InitDefault.EXPLICIT: 3>, scope=<RepoScope.ALL: 1>, files=(), config_key='', ephemeral=False, location_field='', source_file='coverage.toml', tool_section='tool.coverage', sync_mode=<SyncMode.BOOTSTRAP: 1>, customizable_entries=(), legacy_table='', preserved_keys=(), graft_identity_keys=(), overlay=False), ToolConfigComponent(name='mypy', description='Mypy type checking configuration', init_default=<InitDefault.EXPLICIT: 3>, scope=<RepoScope.ALL: 1>, files=(), config_key='', ephemeral=False, location_field='', source_file='mypy.toml', tool_section='tool.mypy', sync_mode=<SyncMode.BOOTSTRAP: 1>, customizable_entries=(), legacy_table='', preserved_keys=(), graft_identity_keys=(), overlay=False), ToolConfigComponent(name='mdformat', description='mdformat Markdown formatter configuration', init_default=<InitDefault.EXPLICIT: 3>, scope=<RepoScope.ALL: 1>, files=(), config_key='', ephemeral=False, location_field='', source_file='mdformat.toml', tool_section='tool.mdformat', sync_mode=<SyncMode.BOOTSTRAP: 1>, customizable_entries=(), legacy_table='', preserved_keys=(), graft_identity_keys=(), overlay=False))¶
Every tool config
initseeds once and never revisits.
- tests.test_lint_repo.test_missing_template_entries(template, local, expected)[source]¶
Only absence is drift: a tuned value and a local addition are not.
- tests.test_lint_repo.test_template_member_name(member, expected)[source]¶
A scalar is its own name, and a table is named by its inline TOML.
- tests.test_lint_repo.test_bootstrap_config_drift_passes_on_its_own_template(comp)[source]¶
A section holding the bundle verbatim is missing nothing.
- tests.test_lint_repo.test_bootstrap_config_drift_reports_a_dropped_entry(comp)[source]¶
A knob the template gained after seeding reaches nobody on its own.
kdeldycke/dotfilescarried a[tool.ruff]seeded before the bundle addedD301tolint.ignore.initnever revisits a BOOTSTRAP section, so the rule stayed absent with nothing reporting it.
- tests.test_lint_repo.test_bootstrap_config_drift_keeps_a_customized_placeholder()[source]¶
--cov=.names the project’s own package, so its absence is not drift.
- tests.test_lint_repo.test_bootstrap_config_drift_reads_the_pytest_legacy_table()[source]¶
A section kept under
ini_optionsis measured there, not reported empty.pytest refuses a file carrying both
[tool.pytest]keys and[tool.pytest.ini_options], so reporting the template’s keys as missing from[tool.pytest]would prescribe a configuration pytest rejects.
- tests.test_lint_repo.test_template_table_member_names_write_the_member()[source]¶
The name of a table must be TOML that writes that same table.
The name is what a maintainer pastes into the section. A name that parsed to anything else would have them copy an entry the template does not hold, and the warning would stay.
- tests.test_lint_repo.test_bootstrap_config_drift_declines_any_reportable_entry(comp, keys, member)[source]¶
Every entry the check reports can be declined, at its path in the section.
A missing key and a missing list member are named the way the tool’s own section names them, so no entry needs a syntax of its own.
- tests.test_lint_repo.test_bootstrap_config_drift_keeps_reporting_the_siblings_of_a_declined_member()[source]¶
Declining one member of a list says nothing about the others.
- tests.test_lint_repo.test_bootstrap_config_drift_declines_an_entry_of_the_pytest_legacy_table()[source]¶
An entry is named below the tool, wherever the section keeps its keys.
- tests.test_lint_repo.test_bootstrap_config_drift_wants_a_reason(reason)[source]¶
An entry mapped to no reason declines nothing: the reason is the point.
- tests.test_lint_repo.test_bootstrap_config_drift_reports_an_entry_that_declines_nothing(leaf, verdict)[source]¶
A record that outlived its subject is reported, like the gap it hid.
The section took the entry back, the template dropped it, or the path never named one: in each case the record now states a decision nobody is making, and the next real gap at that path would arrive already declined.
- tests.test_lint_repo.test_bootstrap_config_drift_points_a_list_entry_at_its_missing_member()[source]¶
An entry naming a list the section carries points at the member it lacks.
The entry was right while the section had no such key. Once the section gains the key without the member, the gap moves down to the member, and the record has to follow it there.
- tests.test_lint_repo.test_bootstrap_config_drift_roster_entry_reads_the_declined_table()[source]¶
The roster hands the check the table, not only the section it measures.
- tests.test_lint_repo.test_bootstrap_config_drift_is_settled_in_this_repository()[source]¶
This repository carries or declines every entry of its seeded templates.
A declined table is keyed by its inline TOML, so the record stops applying the day that rendering changes. The check then only warns, which nobody reads on a green run.
- tests.test_lint_repo.test_lint_context_keeps_the_configuration_it_is_given(tmp_path, monkeypatch)[source]¶
from_projecthands the checks the configuration the command resolved.
- tests.test_lint_repo.test_customizable_entries_exist_in_their_template(comp)[source]¶
A placeholder declaration goes stale silently, and then hides real drift.
- tests.test_lint_repo.test_customizable_entries_are_bootstrap_only(comp)[source]¶
An ongoing sync re-derives the section, so it has no placeholder to keep.
- tests.test_lint_repo.BUNDLED_LYCHEE_EXCLUDES = ('^https://github.com/.+/issues/[0-9]+#issuecomment-.*$', '^https://github.com/.+/releases/.+/download/.*$', '^https://doi.org/.+/zenodo.*$', 'archive\\.ph', 'sci-hub\\.st', 'ycombinator\\.com', '^https://(www\\.)?x\\.com(/.*)?$', '^https://www\\.virustotal\\.com/gui/.*$', 'bitdefender\\.com', '^https://(www\\.)?medium\\.com(/.*)?$', '^https://www\\.npmjs\\.com/package/.*$', 'githubstatus\\.com', '^https://claude\\.ai/.*$')¶
The canonical
[tool.lychee] excludelist every deployed repository starts from.
- tests.test_lint_repo.test_anchored_exclude_core(pattern, expected)[source]¶
Only an anchored host-only pattern replaced a bare form.
- tests.test_lint_repo.test_superseded_local_excludes_passes_on_the_bundle()[source]¶
A section holding the bundle verbatim superseded nothing.
- tests.test_lint_repo.test_superseded_local_excludes_reports_a_bare_entry_the_bundle_anchored()[source]¶
The graft appends a local-only item and never retires a replaced one.
Every awesome list carried a bare
x\.combeside the anchored form the bundle replaced it with, so lychee went on excluding every domain ending inx.comin all four of them.
- tests.test_lint_repo.test_superseded_local_excludes_replaces_a_bare_entry_left_alone()[source]¶
A section no sync reaches lacks the anchored form, so a drop loses the host.
A repository outside the awesome-only scope keeps its own
[tool.lychee]copy, carrying the barex\.comwhere the bundle now has the anchored form. Dropping it there would stop excludingx.comitself.
- tests.test_lint_repo.test_superseded_local_excludes_keeps_a_local_bare_entry_with_no_twin()[source]¶
A repository’s own bare pattern is a customization, not a leftover.
- tests.test_lint_repo.test_superseded_local_excludes_keeps_a_local_anchored_entry()[source]¶
An anchored local pattern narrows rather than broadens, so it is kept.
- tests.test_lint_repo.test_superseded_local_excludes_reports_an_entry_the_bundle_dropped()[source]¶
The graft keeps an entry the template dropped, with nothing to pair it with.
The bundle stopped excluding star-history.com in
8.0.0, and a repository whose section carried the entry kept it, though no link of its own needed it.
- tests.test_lint_repo.test_superseded_local_excludes_keeps_a_dropped_entry_the_bundle_restored()[source]¶
An entry the bundle carries again is canonical, whatever it dropped before.
- tests.test_lint_repo.test_retired_template_excludes_are_gone_from_the_bundle(tool, entry)[source]¶
A retired entry the bundle still carries would be reported against itself.
- tests.test_lint_repo.test_superseded_local_excludes_ignores_a_tool_with_no_patterns()[source]¶
Only a synced array of URL patterns has an anchored/bare distinction.
- tests.test_lint_repo.test_bundled_excludes_never_carry_both_forms()[source]¶
Guard the bundle itself against the pair this check reports downstream.
Not retroactive coverage: the bundle anchored
x\.comwithout ever shipping both forms, so the stale copies lived downstream alone. What this catches is the next time an entry is anchored here, since a bare pattern beside its anchored replacement is canonical in both and no downstream check can report it as drift.
- tests.test_lint_repo.test_every_host_only_anchored_bundle_entry_is_readable()[source]¶
An anchored entry the core extractor cannot read silently narrows the check.
anchored_exclude_core()recognises one shape. A host-only entry written in another answersNone, so a bare downstream copy of it would go unreported. A path-shaped entry is expected to answerNone: no bare form of one was ever bundled on its own.
- tests.test_lint_repo.test_pages_redirects_clean_file_passes(tmp_path, monkeypatch)[source]¶
A file the engine keeps whole reports one green line.
- tests.test_lint_repo.test_pages_redirects_reports_dropped_rules(tmp_path, monkeypatch)[source]¶
Every line the engine drops surfaces with its file position.
These are the failures
wrangler pages deployswallows: a duplicate source, a bad status, an infinite loop. Each dropped line is a redirect that looks committed and is dead in production.
- tests.test_lint_repo.test_pages_redirects_reports_budget_abort_and_misordering(tmp_path, monkeypatch)[source]¶
The silent kill switch: statics after a dynamic burn the 100 budget.
The file below opens with a dynamic rule, so every following static is charged against the dynamic budget of 100. The 101st charged rule (line 101, however static it looks) aborts the parse, and everything below it is discarded without a word from the deploy pipeline.
- tests.test_lint_repo.test_pages_redirects_names_a_url_a_surviving_pattern_captured(tmp_path, monkeypatch)[source]¶
An abandoned exact rule whose URL a broader pattern now answers.
The reader can find a dead redirect by following it. One that still redirects, to somewhere its author never wrote, looks healthy from the outside, so naming the new destination is the only way it surfaces.
- tests.test_lint_repo.test_pages_redirects_caps_the_urls_it_names(tmp_path, monkeypatch)[source]¶
A tail of hundreds is summarized, not dumped into one lint message.
- tests.test_lint_repo.test_pages_redirects_names_the_exact_rules_a_pattern_shadows(tmp_path, monkeypatch)[source]¶
An exact rule below a pattern that matches it is dead, and the lint says so.
Moving it above the patterns is the fix, and it is also a change: the rule starts to fire. The failure names each such rule with the pattern that answers in its place, so the reader knows which answers the reorder moves.
- tests.test_lint_repo.test_pages_redirects_reports_rules_that_cannot_work(tmp_path, monkeypatch, line, fragment)[source]¶
Rules the parser keeps and production still breaks, each with its line.
The engine reports none of them: it drops a source it cannot compile at run time, and a destination token it does not replace reaches the visitor as literal text.
- tests.test_lint_repo.test_pages_redirects_accepts_a_literal_colon_in_an_exact_rule(tmp_path, monkeypatch)[source]¶
An exact source captures nothing, so a colon in its destination is text.
- tests.test_lint_repo.test_pages_redirects_check_is_fatal_and_gated_on_the_file()[source]¶
The roster entry must fail the run: dropped rules are already broken.
- tests.test_lint_repo.test_pages_redirects_honours_gitignore(tmp_path, monkeypatch)[source]¶
A generated copy of the file must not be audited, only the source.
A static site build copies
_redirectsverbatim into its output tree, so without the gitignore filter every finding would be reported twice, and a stale build artifact could fail the lint after the source was fixed.
- tests.test_lint_repo.test_wrangler_config_check(tmp_path, monkeypatch, wrangler_toml, config_fields, repo_name, expected_failures)[source]¶
wrangler.tomlmust agree with the declared project name and date.The file only feeds local wrangler commands on a Direct Upload project, which is exactly why nothing else ever catches it lying: one project’s compatibility date sat three years behind the live value this way.
- tests.test_lint_repo.test_cli_passes_a_project_with_nothing_wrong(tmp_path, monkeypatch)[source]¶
lint-repoprints each verdict and exits 0 when no fatal check fails.
- tests.test_lint_repo.test_cli_fails_on_a_fatal_finding(tmp_path, monkeypatch)[source]¶
A fatal check failing turns into an error annotation and exit code 1.
- tests.test_lint_repo.test_topics_all_in_keywords()[source]¶
No warning when all topics are in keywords.
- tests.test_lint_repo.test_topics_extra_not_in_keywords()[source]¶
Warning when topics exist that are not in keywords.
- tests.test_lint_repo.test_topics_match_keywords_case_insensitively()[source]¶
GitHub lowercases topics, so a capitalized keyword still counts.
- tests.test_lint_repo.test_topics_match_multi_word_keywords(keyword)[source]¶
A topic holds no whitespace, so a phrase counts as its hyphenated form.
- tests.test_lint_repo.test_topics_phrase_keyword_does_not_declare_its_words()[source]¶
A phrase declares its hyphenated topic, not one topic per word.
- tests.test_lint_repo.test_topics_unreadable_repository()[source]¶
Skip gracefully when the repository object cannot be read.
- tests.test_lint_repo.test_stale_gh_pages_branch_absent_passes()[source]¶
A 404 is the desired state: the branch is gone.
- tests.test_lint_repo.test_stale_gh_pages_branch_present_fails()[source]¶
A readable branch is the stale leftover the check exists to flag.
- tests.test_lint_repo.test_stale_gh_pages_branch_api_failure_skips()[source]¶
An unreadable API is a skip, never a pass.
An auth flap or a rate limit must not vouch for a branch nobody read.
- tests.test_lint_repo.FRAGMENT_GUARD_CONF = 'extensions = ["myst_parser", "click_extra.sphinx"]\nclick_extra_fail_on_warnings = ["myst.xref_missing"]\n'¶
A
conf.pywhose build fails on a fragment link that lands nowhere.
- tests.test_lint_repo.SET_FAIL_ON_WARNINGS = 'set `click_extra_fail_on_warnings = ["myst.xref_missing"]`'¶
The fix a
conf.pygets when no fail-on-warnings entry covers the type.
- tests.test_lint_repo.ADD_CLICK_EXTRA_SPHINX = 'add `click_extra.sphinx` to `extensions`'¶
The fix a
conf.pygets when no loaded extension reads the setting.
- tests.test_lint_repo.test_sphinx_fragment_links(tmp_path, monkeypatch, conf, fixes)[source]¶
The build fails on
myst.xref_missingonly when three settings agree.The setting must list the type, an extension must read it, and no
suppress_warningsentry may hide the type from it. A failure names every fix it needs, so one read of the warning is enough to repairconf.py.
- tests.test_lint_repo.test_sphinx_fragment_links_only_applies_to_a_myst_project()[source]¶
A project without MyST-Parser has no
myst.xref_missingto fail on.
- tests.test_lint_repo.test_title_octicons(tmp_path, monkeypatch, pages, message)[source]¶
Each page title takes the octicon of its registry row, and only its row.
A page that the registry does not list, a sidebar octicon, and two pages sharing an octicon outside a declared family each warn. A generated module page and a page with no
#title are not checked.
- tests.test_lint_repo.test_title_octicons_only_applies_to_a_myst_project()[source]¶
The check reads the MyST pages of a Sphinx project.
- tests.test_lint_repo.test_octicon_registry_is_consistent()[source]¶
The rows sort by octicon, and each pattern resolves to its own row.
A page that two rows list resolves to the first, so the second row fails. No row takes a sidebar octicon, and a family names pages of its own row.
- tests.test_lint_repo.test_sphinx_docs_agent_carries_the_octicon_registry()[source]¶
The registry table of the
sphinx-docsagent renders from the data file.The agent ships to repositories that have no copy of the data file, so it carries the table itself.
docs/docs_update.py, which repomatic update-docs runs, rewrites the table after an edit to the data file.
- tests.test_lint_repo.test_funding_file_exists(tmp_path, monkeypatch, filename)[source]¶
No warning when funding file already exists, whatever its case.
- tests.test_lint_repo.test_funding_missing_with_sponsors(tmp_path, monkeypatch)[source]¶
Warning when owner has sponsors but no funding file.
- tests.test_lint_repo.test_funding_skipped_for_fork(tmp_path, monkeypatch)[source]¶
Skip funding check for forked repositories, before asking about Sponsors.
- tests.test_lint_repo.test_funding_skipped_no_sponsors(tmp_path, monkeypatch)[source]¶
Skip when owner has no GitHub Sponsors listing.
- tests.test_lint_repo.test_funding_unreadable_payload(tmp_path, monkeypatch, repo_object, graphql_error)[source]¶
Skip gracefully when the GitHub API cannot be read.
- tests.test_lint_repo.test_instructions_file_name(tmp_path, monkeypatch, names, passed, needles)[source]¶
Report a retired
claude.mdor a wrong case in place ofAGENTS.md.
- tests.test_lint_repo.test_instructions_file_name_warns_without_a_repository()[source]¶
The check reads the root of the tree: it needs no repository and never fails.
- tests.test_lint_repo.test_workflow_permissions(tmp_path, monkeypatch, workflow, expect_fail, needle)[source]¶
Flag starved reusable calls and custom-step workflows missing the key.
- tests.test_lint_repo.test_workflow_permissions_skip_without_workflows(tmp_path, monkeypatch)[source]¶
A repository holding no workflow has nothing to report on.
- tests.test_lint_repo.CANONICAL_TEMPLATE_PATH = '.github/pr-templates/sync-fruit-basket.md'¶
Where a repository-local PR body template is expected to live.
- tests.test_lint_repo.CONFORMING_TEMPLATE = '---\ntitle: Sync fruit basket\nfooter: false\n---\n\nBody.\n'¶
A template passing every frontmatter rule.
- tests.test_lint_repo.test_pr_templates(tmp_path, monkeypatch, arg_path, file_path, body, needle)[source]¶
Flag misplaced, missing, and malformed repository-local PR templates.
- tests.test_lint_repo.test_pr_templates_equals_form(tmp_path, monkeypatch)[source]¶
--template-file=pathis matched the same as the space-separated form.
- tests.test_lint_repo.test_pr_templates_referenced_and_on_disk_reported_once(tmp_path, monkeypatch)[source]¶
A template both referenced and on disk is one candidate, not two.
A workflow always spells the path with
/, while the directory glob yields the native separator, so a naive union of the two reports the same template twice on Windows, the second time without its referencing workflow.
- tests.test_lint_repo.test_pr_templates_unreferenced_still_checked(tmp_path, monkeypatch)[source]¶
A template no workflow names is still validated, so drift stays visible.
- tests.test_lint_repo.test_pr_templates_skipped(tmp_path, monkeypatch, make_workflows_dir)[source]¶
Skip cleanly when there is no workflow directory, or nothing to check.
- tests.test_lint_repo.test_stale_drafts_detected()[source]¶
Warn about draft releases that are not dev pre-releases.
- tests.test_lint_repo.test_stale_drafts_none()[source]¶
No warning when only dev pre-release drafts exist.
- tests.test_lint_repo.test_stale_drafts_unreadable_payload()[source]¶
Skip gracefully when the release list cannot be read.
- tests.test_lint_repo.test_stale_drafts_multiple()[source]¶
List all stale draft tags in the warning.
- tests.test_lint_repo.GUIDE_CONTEXT = LintContext(config=Config(abandoned_versions=[], action_pins_sync=True, awesome_template_sync=True, binaries_sync=True, bumpversion_sync=True, cache=CacheConfig(dir='', github_releases_ttl=86400, max_age=30, npm_ttl=86400, pypi_ttl=86400), changelog_archive_location='', changelog_bullet_word_threshold=40, changelog_location='./changelog.md', debug_sync=False, dep_sources_sync=True, dependency_graph=DependencyGraphConfig(all_extras=True, all_groups=True, level=None, no_extras=[], no_groups=[], output='./docs/assets/dependencies.mmd', update=True), dev_release_sync=True, docs=DocsConfig(apidoc_exclude=[], apidoc_extra_args=[], update_script='./docs/docs_update.py'), exclude=[], github_releases_sync=True, gitignore=GitignoreConfig(extra_categories=[], extra_content='# Claude Code local files.\n.claude/scheduled_tasks.lock\n.claude/settings.local.json\n**/.claude/.cc-writes/\n\n# Agent skill scripts, which the virtualenv `[Ss]cripts` rule ignores.\n!**/skills/*/scripts/\n\n# Cloudflare wrangler local state.\n.wrangler/\n\n# Sphinx linkcheck output.\ndocs/_linkcheck/', location='./.gitignore', sync=True), include=[], labels=LabelsConfig(content_rules={}, extra=[], extra_files=[], file_rules={}, sync=True), lint_deps=LintDepsConfig(allow={}, comment_word_threshold=40), lint_repo=LintRepoConfig(declined={}), mailmap_sync=True, manpages_asset_name='', manpages_script='', metrics=MetricsConfig(charts=[], colors={}, forges={}, predecessors={}, store='./docs/assets/metrics.csv', subjects={}, sync=False), minimum_release_age='1 week', notification_max_unsubscribes=200, notification_months=3, notification_unsubscribe=False, nuitka_dev_targets=['linux-arm64'], nuitka_enabled=True, nuitka_entry_points=[], nuitka_extras=[], nuitka_nofollow_imports=['tkinter'], nuitka_unstable_targets=[], pypi_package_history=[], release_assets=[], settings_location='./.claude/settings.json', setup_guide=True, site_cloudflare_compatibility_date='', site_cloudflare_placement='', site_cloudflare_project='', site_cloudflare_r2_bucket='', site_cloudflare_r2_domain='', site_deploy='github-pages', skills_location='./.claude/skills/', sphinx_builder='html', sphinx_fail_on_warning=False, subagents_location='./.claude/agents/', sync_runner_images=SyncRunnerImagesConfig(ignore=[], sync=True), test_matrix=TestMatrixConfig(exclude=[], full_include=[], include=[], remove={}, replace={}, unstable=[], variations={}), tool_versions_sync=True, upstream_pin_sync=True, uv_lock_sync=True, vulnerable_deps=VulnerableDepsConfig(sources=['uv-audit', 'github-advisories'], sync=True), workflow=WorkflowConfig(source_paths=None, extra_paths=[], ignore_paths=[], paths={}, sync=True), workflow_pins_ignore=[], workflow_pins_sync=True), repo='owner/repo', repo_name=None, package_name=None, is_package=False, is_sphinx=False, uses_myst=False, has_changelog=False, project_description=None, docs_url=None, keywords=None, tool_table={}, nuitka_active=False, has_pat=False, has_virustotal_key=False, has_cloudflare_api_token=False, has_cloudflare_r2_keys=False, has_notifications_pat=False)¶
The context the install guide checks read, a repository and nothing else.
- tests.test_lint_repo.test_install_guide_downloads_all_present(tmp_path, monkeypatch)[source]¶
Pass when every referenced file is attached to its release.
- tests.test_lint_repo.test_install_guide_downloads_latest_alias_present(tmp_path, monkeypatch)[source]¶
Check a versionless alias against the latest release, with no tag.
- tests.test_lint_repo.test_install_guide_downloads_latest_alias_renamed(tmp_path, monkeypatch)[source]¶
Warn on an alias naming a file the latest release renamed away.
This is the
meta-package-managershape: binaries went frommpm-*tometa-package-manager-*in7.0.0, and nothing rewrites an alias URL, so the guide kept advertising a 404 across six releases.
- tests.test_lint_repo.test_install_guide_downloads_missing_asset(tmp_path, monkeypatch)[source]¶
Warn naming each referenced file the release does not carry.
- tests.test_lint_repo.test_install_guide_downloads_release_without_assets(tmp_path, monkeypatch)[source]¶
A release carrying no assets at all reports every referenced file.
This is the
7.7.0shape: the release published, so the API answers, but the binary upload never ran.
- tests.test_lint_repo.test_install_guide_downloads_skipped(tmp_path, monkeypatch, body, needle)[source]¶
Skip when there is no guide, or no download URL to verify.
- tests.test_lint_repo.test_install_guide_downloads_unreadable_release(tmp_path, monkeypatch)[source]¶
Skip rather than warn when the release cannot be read.
A transient API failure must not be reported as a broken install guide.
- tests.test_lint_repo.SETTINGS_CONTEXT = LintContext(config=Config(abandoned_versions=[], action_pins_sync=True, awesome_template_sync=True, binaries_sync=True, bumpversion_sync=True, cache=CacheConfig(dir='', github_releases_ttl=86400, max_age=30, npm_ttl=86400, pypi_ttl=86400), changelog_archive_location='', changelog_bullet_word_threshold=40, changelog_location='./changelog.md', debug_sync=False, dep_sources_sync=True, dependency_graph=DependencyGraphConfig(all_extras=True, all_groups=True, level=None, no_extras=[], no_groups=[], output='./docs/assets/dependencies.mmd', update=True), dev_release_sync=True, docs=DocsConfig(apidoc_exclude=[], apidoc_extra_args=[], update_script='./docs/docs_update.py'), exclude=[], github_releases_sync=True, gitignore=GitignoreConfig(extra_categories=[], extra_content='# Claude Code local files.\n.claude/scheduled_tasks.lock\n.claude/settings.local.json\n**/.claude/.cc-writes/\n\n# Agent skill scripts, which the virtualenv `[Ss]cripts` rule ignores.\n!**/skills/*/scripts/\n\n# Cloudflare wrangler local state.\n.wrangler/\n\n# Sphinx linkcheck output.\ndocs/_linkcheck/', location='./.gitignore', sync=True), include=[], labels=LabelsConfig(content_rules={}, extra=[], extra_files=[], file_rules={}, sync=True), lint_deps=LintDepsConfig(allow={}, comment_word_threshold=40), lint_repo=LintRepoConfig(declined={}), mailmap_sync=True, manpages_asset_name='', manpages_script='', metrics=MetricsConfig(charts=[], colors={}, forges={}, predecessors={}, store='./docs/assets/metrics.csv', subjects={}, sync=False), minimum_release_age='1 week', notification_max_unsubscribes=200, notification_months=3, notification_unsubscribe=False, nuitka_dev_targets=['linux-arm64'], nuitka_enabled=True, nuitka_entry_points=[], nuitka_extras=[], nuitka_nofollow_imports=['tkinter'], nuitka_unstable_targets=[], pypi_package_history=[], release_assets=[], settings_location='./.claude/settings.json', setup_guide=True, site_cloudflare_compatibility_date='', site_cloudflare_placement='', site_cloudflare_project='', site_cloudflare_r2_bucket='', site_cloudflare_r2_domain='', site_deploy='github-pages', skills_location='./.claude/skills/', sphinx_builder='html', sphinx_fail_on_warning=False, subagents_location='./.claude/agents/', sync_runner_images=SyncRunnerImagesConfig(ignore=[], sync=True), test_matrix=TestMatrixConfig(exclude=[], full_include=[], include=[], remove={}, replace={}, unstable=[], variations={}), tool_versions_sync=True, upstream_pin_sync=True, uv_lock_sync=True, vulnerable_deps=VulnerableDepsConfig(sources=['uv-audit', 'github-advisories'], sync=True), workflow=WorkflowConfig(source_paths=None, extra_paths=[], ignore_paths=[], paths={}, sync=True), workflow_pins_ignore=[], workflow_pins_sync=True), repo='owner/repo', repo_name=None, package_name=None, is_package=False, is_sphinx=False, uses_myst=False, has_changelog=False, project_description=None, docs_url=None, keywords=None, tool_table={}, nuitka_active=False, has_pat=False, has_virustotal_key=False, has_cloudflare_api_token=False, has_cloudflare_r2_keys=False, has_notifications_pat=False)¶
The context the repository-setting checks read, a repository and nothing else.
- tests.test_lint_repo.test_sha_pinning_required_enabled()[source]¶
Pass when the repository requires SHA pinning for Actions.
- tests.test_lint_repo.test_sha_pinning_required_disabled()[source]¶
Warn with a fix link when SHA pinning is not required.
- tests.test_lint_repo.test_sha_pinning_required_unreadable_payload()[source]¶
Skip gracefully when the permissions payload cannot be read.
- tests.test_lint_repo.test_pat_checks_skipped_without_pat()[source]¶
The PAT checks report one skip line when no PAT is configured.
- tests.test_lint_repo.test_pat_checks_need_a_repository_to_probe()[source]¶
A PAT with no repository to probe reports nothing, rather than a pass.
- tests.test_lint_repo.test_pat_checks_all_pass()[source]¶
Every probe’s own success message reaches the report.
- tests.test_lint_repo.test_pat_checks_fail_on_missing_permission()[source]¶
A missing permission fails the run.
The roster reads the scope probe the setup guide reads too, once.
- tests.test_lint_repo.test_pat_permission_entry_names_every_probe()[source]¶
The help and the docs list the permissions the probes cover, all of them.
- tests.test_lint_repo.test_bootstrap_entry_names_every_seeded_section()[source]¶
The docs list every tool section
initseeds once.
- tests.test_lint_repo.PUBLISHER_CONTEXT = LintContext(config=Config(abandoned_versions=[], action_pins_sync=True, awesome_template_sync=True, binaries_sync=True, bumpversion_sync=True, cache=CacheConfig(dir='', github_releases_ttl=86400, max_age=30, npm_ttl=86400, pypi_ttl=86400), changelog_archive_location='', changelog_bullet_word_threshold=40, changelog_location='./changelog.md', debug_sync=False, dep_sources_sync=True, dependency_graph=DependencyGraphConfig(all_extras=True, all_groups=True, level=None, no_extras=[], no_groups=[], output='./docs/assets/dependencies.mmd', update=True), dev_release_sync=True, docs=DocsConfig(apidoc_exclude=[], apidoc_extra_args=[], update_script='./docs/docs_update.py'), exclude=[], github_releases_sync=True, gitignore=GitignoreConfig(extra_categories=[], extra_content='# Claude Code local files.\n.claude/scheduled_tasks.lock\n.claude/settings.local.json\n**/.claude/.cc-writes/\n\n# Agent skill scripts, which the virtualenv `[Ss]cripts` rule ignores.\n!**/skills/*/scripts/\n\n# Cloudflare wrangler local state.\n.wrangler/\n\n# Sphinx linkcheck output.\ndocs/_linkcheck/', location='./.gitignore', sync=True), include=[], labels=LabelsConfig(content_rules={}, extra=[], extra_files=[], file_rules={}, sync=True), lint_deps=LintDepsConfig(allow={}, comment_word_threshold=40), lint_repo=LintRepoConfig(declined={}), mailmap_sync=True, manpages_asset_name='', manpages_script='', metrics=MetricsConfig(charts=[], colors={}, forges={}, predecessors={}, store='./docs/assets/metrics.csv', subjects={}, sync=False), minimum_release_age='1 week', notification_max_unsubscribes=200, notification_months=3, notification_unsubscribe=False, nuitka_dev_targets=['linux-arm64'], nuitka_enabled=True, nuitka_entry_points=[], nuitka_extras=[], nuitka_nofollow_imports=['tkinter'], nuitka_unstable_targets=[], pypi_package_history=[], release_assets=[], settings_location='./.claude/settings.json', setup_guide=True, site_cloudflare_compatibility_date='', site_cloudflare_placement='', site_cloudflare_project='', site_cloudflare_r2_bucket='', site_cloudflare_r2_domain='', site_deploy='github-pages', skills_location='./.claude/skills/', sphinx_builder='html', sphinx_fail_on_warning=False, subagents_location='./.claude/agents/', sync_runner_images=SyncRunnerImagesConfig(ignore=[], sync=True), test_matrix=TestMatrixConfig(exclude=[], full_include=[], include=[], remove={}, replace={}, unstable=[], variations={}), tool_versions_sync=True, upstream_pin_sync=True, uv_lock_sync=True, vulnerable_deps=VulnerableDepsConfig(sources=['uv-audit', 'github-advisories'], sync=True), workflow=WorkflowConfig(source_paths=None, extra_paths=[], ignore_paths=[], paths={}, sync=True), workflow_pins_ignore=[], workflow_pins_sync=True), repo='owner/cherries', repo_name=None, package_name='cherries', is_package=False, is_sphinx=False, uses_myst=False, has_changelog=False, project_description=None, docs_url=None, keywords=None, tool_table={}, nuitka_active=False, has_pat=False, has_virustotal_key=False, has_cloudflare_api_token=False, has_cloudflare_r2_keys=False, has_notifications_pat=False)¶
A published package whose Trusted Publisher entry the tests below probe.
- tests.test_lint_repo.test_pypi_trusted_publisher_no_release()[source]¶
Skip when the package has no published version.
- tests.test_lint_repo.test_pypi_trusted_publisher_no_provenance()[source]¶
Indeterminate when provenance fetch fails (pre-OIDC release).
- tests.test_lint_repo.test_pypi_trusted_publisher_empty_bundles()[source]¶
Indeterminate when provenance contains no publisher bundles.
- tests.test_lint_repo.test_pypi_trusted_publisher_match()[source]¶
Pass when a publisher bundle names this repo and
release.yaml.
- tests.test_lint_repo.test_pypi_trusted_publisher_workflow_mismatch()[source]¶
Fail when provenance names a different workflow.
- tests.test_lint_repo.test_pypi_trusted_publisher_repository_mismatch()[source]¶
Fail when provenance names a different repository (like the upstream one).
- tests.test_lint_repo.test_pypi_trusted_publisher_queries_the_canonical_name()[source]¶
PyPI is asked about the name it files the project under, not the raw one.
[project] name = "Fig_Tree"is published asfig-tree, the form the settings page and the setup guide use too.
- tests.test_lint_repo.test_pypi_trusted_publisher_gated_on_a_published_package(fields, applies)[source]¶
A uv virtual project shares its
[project] name, and publishes nothing.
- tests.test_lint_repo.test_immutable_releases_gated_on_the_changelog(has_changelog, applies)[source]¶
The setup guide and the lint gate the immutable releases step alike.
The release workflow publishes a GitHub release for any project holding a changelog, Python package or not, so the changelog is the gate.
- tests.test_lint_repo.test_check_test_matrix_excludes(tmp_path, monkeypatch, runner, stale)[source]¶
An exclude naming a runner the matrix no longer has is a warning.
- tests.test_lint_repo.test_check_test_matrix_excludes_names_only_the_stale_half(tmp_path, monkeypatch)[source]¶
A partially stale exclude is reported by its stale values alone.
Under
full-includethe emitted matrix is a flat job list whoseall_variations()is empty, so its axes must come from elsewhere: read from there, every key of the entry would count as absent, and the message would blame the live half along with the stale one.
- tests.test_lint_repo.test_python_floor_disagreeing_with_classifiers(tmp_path, monkeypatch)[source]¶
A floor below the lowest classifier misreports what installs.
- tests.test_lint_repo.test_python_matrix_missing_an_advertised_boundary(tmp_path, monkeypatch)[source]¶
Advertising a version the matrix never reaches is untested support.
- tests.test_lint_repo.test_python_matrix_may_skip_intermediate_versions(tmp_path, monkeypatch)[source]¶
Only the ends of the range are mandatory, to keep CI load a free choice.
- tests.test_lint_repo.test_python_matrix_testing_an_unadvertised_version(tmp_path, monkeypatch)[source]¶
A released version tested but not advertised is support left unclaimed.
- tests.test_lint_repo.test_python_matrix_tolerates_unreleased_versions(tmp_path, monkeypatch)[source]¶
An in-development version cannot be advertised, so it is exempt.
- tests.test_lint_repo.test_python_matrix_built_at_runtime_is_skipped(tmp_path, monkeypatch)[source]¶
A
fromJSONmatrix is opaque, and its axes are canonical already.
- tests.test_lint_repo.test_runner_images(runner, expect_fail, needle)[source]¶
Floating aliases and off-axis images are flagged; expressions are not.
- tests.test_lint_repo.test_runner_images_ignores_thin_callers()[source]¶
A job with no steps delegates, and its runner is the callee’s business.
- tests.test_lint_repo.test_runner_images_declined(runner, expected)[source]¶
A label in
sync-runner-images.ignoreis a decision, except an alias.
- tests.test_lint_repo.test_workflow_dispatch(body, passed, needle)[source]¶
The
workflow_dispatchcheck reports presence and absence.
- tests.test_lint_repo.test_workflow_dispatch_leaves_out_reusable_workflows_and_callers(body)[source]¶
A reusable workflow starts as its callers decide, a thin caller as it calls.
- tests.test_lint_repo.test_workflow_dispatch_settled_in_this_repository()[source]¶
This repository’s own workflows carry the trigger, or are exempt from it.
_release-build.yaml,_release-engine.yamlandcancel-runs.yamllack a manual trigger on purpose, andlint-reporuns on every push here.
- tests.test_lint_repo.test_thin_caller_pins(ref, passed, needle)[source]¶
A caller must pin the upstream workflow to a release, never to a branch.
- tests.test_lint_repo.test_thin_caller_checks_skip_without_a_thin_caller()[source]¶
A repository calling no upstream workflow has no caller to check.
- tests.test_lint_repo.test_thin_caller_triggers_extra()[source]¶
Fail when a caller declares a trigger absent from canonical.
- tests.test_lint_repo.test_thin_caller_triggers_skip_a_workflow_this_release_lacks()[source]¶
A caller of an upstream workflow this release does not ship is not judged.
- tests.test_lint_repo.test_generated_release_caller_lints_clean()[source]¶
The generated downstream
release.yamlpasses every workflow check.It synthesizes
pushandworkflow_dispatchbecause_release-engine.yamlis call-only, and its build lane calls a workflow that declares no secrets.
- tests.test_lint_repo.test_generated_cancel_runs_caller_is_exempt_from_the_dispatch_check()[source]¶
cancel-runs.yamllacks a manual trigger on purpose, and so may its caller.
- tests.test_lint_repo.ALL_RELEASE_SECRETS = ' secrets:\n REPOMATIC_PAT: ${{ secrets.REPOMATIC_PAT }}\n VIRUSTOTAL_API_KEY: ${{ secrets.VIRUSTOTAL_API_KEY }}\n'¶
Every secret
_release-engine.yamldeclares, passed explicitly.
- tests.test_lint_repo.test_thin_caller_secrets(workflow, secrets_block, passed, needle)[source]¶
A caller must forward every secret its canonical workflow declares.
- tests.test_lint_repo.test_thin_caller_secrets_read_the_job_calling_the_canonical_workflow()[source]¶
Another job’s
secrets:never stands in for the canonical lane’s.The build lane comes first in the downstream
release.yaml. Read in document order, its partial mapping would be held against the engine’s secrets, and the engine lane’s own complete mapping never read.
- tests.test_lint_repo.test_inline_pins_match_upstream_flags_lagging_pin()[source]¶
An inline pin behind the uses: ref version is a fatal error.
- tests.test_lint_repo.test_inline_pins_match_upstream_accepts_synced_pin()[source]¶
An inline pin equal to the uses: ref version passes.
- tests.test_lint_repo.test_inline_pins_match_upstream_skips_without_refs()[source]¶
The canonical repo (local
uv run, no upstream refs) has nothing to check.
- tests.test_lint_repo.test_self_pin_exemption_flags_unexempt_pin()[source]¶
A pin resolving under a cooldown without the bypass is a fatal error.
- tests.test_lint_repo.test_self_pin_exemption_accepts_exempt_pin()[source]¶
The spelling both writers emit passes.
- tests.test_lint_repo.test_self_pin_exemption_ignores_workflow_without_cooldown()[source]¶
No cooldown means nothing to exempt, so a bare pin resolves fine.
- tests.test_lint_repo.test_setup_uv_version_pin_flags_unpinned_step()[source]¶
A step with no
version:input installs whatever uv is newest.
- tests.test_lint_repo.test_setup_uv_version_pin_accepts_pinned_steps()[source]¶
Every step naming the same version passes.
- tests.test_lint_repo.test_setup_uv_version_pin_flags_unpinned_step_next_to_pinned_one()[source]¶
A pinned step does not vouch for an unpinned one beside it.
- tests.test_lint_repo.test_setup_uv_version_pin_flags_split_versions()[source]¶
Steps pinning two versions silently test two uv releases.
- tests.test_lint_repo.test_requested_metadata_keys(command, expected)[source]¶
Positional keys are read off the command line the way Click reads them.
- tests.test_lint_repo.test_metadata_keys_flags_a_retired_key()[source]¶
A key removed upstream fails the lint instead of the next workflow run.
- tests.test_lint_repo.test_metadata_keys_flags_the_removed_alias(command)[source]¶
A step calling the
metadataalias fails the lint, namingshow-metadata.8.0.0removed the alias, so the call dies whatever keys it passes, and even when it passes none.
- tests.test_lint_repo.test_metadata_keys_flags_a_renamed_option(command)[source]¶
A step passing
--formatfails the lint, naming--output-format.8.0.0renamed the option, so the call dies at its first job whatever keys it asks for, and even when it asks for none.
- tests.test_lint_repo.test_metadata_keys_flags_a_renamed_option_beside_a_retired_key()[source]¶
Each fault of one step is reported, so one fix does not uncover another.
- tests.test_lint_repo.test_metadata_keys_accepts_current_keys()[source]¶
Keys the command still answers raise nothing.
- tests.test_lint_repo.test_metadata_keys_skips_a_repo_that_never_calls_it()[source]¶
No invocation to read is a skip, not a pass.
- tests.test_lint_repo.test_metadata_value_options_match_the_command()[source]¶
The hand-listed value options cover every one the command declares.
check_metadata_keyscannot import the CLI to ask (seeMETADATA_VALUE_OPTIONS), so the list is pinned here instead: an option gaining a value would otherwise make the lint read that value as a key. The list may hold more, since a workflow pinned to an older release still spells that release’s options.
- tests.test_lint_repo.test_metadata_keys_covers_every_workflow_of_this_repo()[source]¶
This repository’s own workflows only ask for keys that exist.
- tests.test_lint_repo.test_release_path_without_the_reusable_workflows()[source]¶
A repository holding no release workflow gets one line per gate, and no more.
That is every downstream repository: its thin caller holds no gated step.
- tests.test_lint_repo.test_release_path_reads_the_condition_of_each_gated_step(condition, needle)[source]¶
A release-only step whose
if:misses its metadata key fails the check.
- tests.test_lint_repo.test_release_path_flags_a_gate_on_a_retired_metadata_key()[source]¶
A gate naming a key the metadata no longer carries never opens.
- tests.test_lint_repo.test_check_branch_ruleset_none(rulesets)[source]¶
No active branch ruleset returns failure.
- tests.test_lint_repo.test_check_branch_ruleset_api_error()[source]¶
An unreadable rulesets API is indeterminate, not a failure.
Matches
check_tag_protection_rules, which reads the same payload. The setup guide still treats theNoneas incomplete and keeps the step open.
- tests.test_lint_repo.test_check_tag_protection_rules(rulesets, passed)[source]¶
Only an active ruleset aimed at tags can block the release tag push.
- tests.test_lint_repo.test_check_classic_branch_protection_none()[source]¶
A repository holding only rulesets passes.
- tests.test_lint_repo.test_check_classic_branch_protection_found(patterns, expected)[source]¶
Every surviving rule is named, and both settings pages are linked.
- tests.test_lint_repo.test_check_classic_branch_protection_api_error()[source]¶
Reading the rules needs admin, so a refusal skips instead of passing.
A token without admin gets the same
RuntimeErroras a network failure. AnsweringTruethere would report a clean repository on the strength of a question nobody managed to ask.
- tests.test_lint_repo.test_check_classic_branch_protection_partial_payload(payload)[source]¶
A partial GraphQL response reads as no rules, never as a crash.
GraphQL answers
200with a null branch when a field resolves to nothing, so every level of the envelope can arrive empty.
- tests.test_lint_repo.test_check_immutable_releases(response, passed, fragment)[source]¶
The immutable releases setting reads as on, off or unknown.
- tests.test_lint_repo.test_check_fork_pr_approval_policy(response, passed, fragment)[source]¶
The approval policy passes, fails or skips by the set its value is in.
- tests.test_lint_repo.test_every_check_is_reachable_from_the_roster()[source]¶
Every
check_*the package defines is a checklint-reporuns.A check nobody calls is a check nobody benefits from: adding one means adding it to the roster, or the omission fails here.
- tests.test_lint_repo.test_repo_check_names_are_unique()[source]¶
Two checks sharing a name would make the roster ambiguous to read.
- tests.test_lint_repo.test_help_lists_every_check()[source]¶
lint-repo --helpnames every check the command runs, with its severity.The list renders from
REPO_CHECKS, so this guards the wiring: a placeholder left unfilled, or a check the rendering drops, fails here.
- tests.test_lint_repo.test_check_description_opens_on_its_severity(check)[source]¶
A check’s docs bullet says whether it fails the job or only warns.
A fatal check’s description opens on
Fails, any other onWarns, or onReportsfor one that reports before it warns. The docs page renders these bullets under thelint-repojob, so a wrong verb misstates the severity.
- tests.test_lint_repo.test_workflows_page_renders_every_check()[source]¶
The
lint-repojob docs render the roster rather than a hand-kept list.
- tests.test_lint_repo.test_only_a_fatal_failure_fails_the_run(passed, fatal, fails)[source]¶
A skip or an advisory failure leaves the run green.
- tests.test_lint_repo.test_setup_uv_checksum_coverage_accepts_a_covered_pin()[source]¶
A pinned uv the pinned action can hash is the state worth having.
- tests.test_lint_repo.test_setup_uv_checksum_coverage_flags_an_uncovered_pin()[source]¶
Two good pins can still verify nothing between them.
setup-uvskips validation for a version absent from the table its own release bundles, on a debug line no CI log shows, so nothing else reports this.
- tests.test_lint_repo.test_setup_uv_checksum_coverage_skips_on_an_unreadable_table()[source]¶
An unreachable API is indeterminate, never a red run.
- tests.test_lint_repo.test_setup_uv_checksum_coverage_skips_without_a_pinned_version()[source]¶
An unpinned step is the other check’s finding, not this one’s.
- tests.test_lint_repo.test_setup_uv_checksum_coverage_skips_without_workflows()[source]¶
A repository with no workflow has nothing to check.
- tests.test_lint_repo.COOLDOWN_NOW = datetime.datetime(2026, 10, 20, 12, 0, tzinfo=datetime.timezone.utc)¶
The clock the cooldown tests read, so that no test crosses a UTC midnight.
- tests.test_lint_repo.YOUNG_RELEASE = '2026-10-18'¶
A release date inside the
1 weekwindow atCOOLDOWN_NOW.
- tests.test_lint_repo.OLD_RELEASE = '2026-10-01'¶
A release date past the
1 weekwindow atCOOLDOWN_NOW.
- tests.test_lint_repo.VENV_TOOL = ToolSpec(name='dragon-fruit', display_name=None, version='2.0.0', package=None, module=None, native_config_files=(), config_flag=None, native_format=<NativeFormat.YAML: 'yaml'>, default_config=None, reads_pyproject=False, pyproject_table=None, default_flags=(), ci_flags=(), default_args=(), default_paths=None, per_file=False, with_packages=(), path_tools=(), needs_venv=True, install_into_venv=False, computed_params=None, prepare=None, config_after_subcommand=False, post_process=None, output_flag=None, problem_matcher=None, check_flags=(), rewrite_exit_code=None, binary=None, npm=None, source_url=None, tag_pattern=None, config_docs_url=None, cli_docs_url=None, docs_notes='')¶
A tool installed into the project virtualenv, which reads
[tool.uv].
- tests.test_lint_repo.UVX_TOOL = ToolSpec(name='kiwi', display_name=None, version='1.5.0', package=None, module=None, native_config_files=(), config_flag=None, native_format=<NativeFormat.YAML: 'yaml'>, default_config=None, reads_pyproject=False, pyproject_table=None, default_flags=(), ci_flags=(), default_args=(), default_paths=None, per_file=False, with_packages=(), path_tools=(), needs_venv=False, install_into_venv=False, computed_params=None, prepare=None, config_after_subcommand=False, post_process=None, output_flag=None, problem_matcher=None, check_flags=(), rewrite_exit_code=None, binary=None, npm=None, source_url=None, tag_pattern=None, config_docs_url=None, cli_docs_url=None, docs_notes='')¶
A tool installed by
uvx, which reads no project configuration.
- tests.test_lint_repo.NPM_TOOL = ToolSpec(name='mango', display_name=None, version='3.1.0', package=None, module=None, native_config_files=(), config_flag=None, native_format=<NativeFormat.YAML: 'yaml'>, default_config=None, reads_pyproject=False, pyproject_table=None, default_flags=(), ci_flags=(), default_args=(), default_paths=None, per_file=False, with_packages=(), path_tools=(), needs_venv=False, install_into_venv=False, computed_params=None, prepare=None, config_after_subcommand=False, post_process=None, output_flag=None, problem_matcher=None, check_flags=(), rewrite_exit_code=None, binary=None, npm=NpmSpec(), source_url=None, tag_pattern=None, config_docs_url=None, cli_docs_url=None, docs_notes='')¶
A tool installed by npm into a scratch prefix.
- tests.test_lint_repo.BINARY_TOOL = ToolSpec(name='fig', display_name=None, version='0.9.0', package=None, module=None, native_config_files=(), config_flag=None, native_format=<NativeFormat.YAML: 'yaml'>, default_config=None, reads_pyproject=False, pyproject_table=None, default_flags=(), ci_flags=(), default_args=(), default_paths=None, per_file=False, with_packages=(), path_tools=(), needs_venv=False, install_into_venv=False, computed_params=None, prepare=None, config_after_subcommand=False, post_process=None, output_flag=None, problem_matcher=None, check_flags=(), rewrite_exit_code=None, binary=BinarySpec(urls={}, checksums={}, archive_format=<ArchiveFormat.TAR_GZ: 'tar.gz'>, archive_executable=None, strip_components=0, attestation=None), npm=None, source_url='https://github.com/orchard/fig', tag_pattern=None, config_docs_url=None, cli_docs_url=None, docs_notes='')¶
A tool downloaded as a checksum-pinned binary, with no install-time cooldown.
- tests.test_lint_repo.test_registry_pin_cooldown_warns_without_an_entry(entries)[source]¶
A virtualenv pin inside the window and with no entry fails to install.
The warning carries all a maintainer needs to act on it: the pin, its release date, the day it clears the window, and the entry that admits it now, in the freeze form that
sync-uv-lockprunes once it ages out.
- tests.test_lint_repo.test_registry_pin_cooldown_warns_on_an_entry_older_than_the_release(value)[source]¶
An entry whose cutoff can fall before the upload admits nothing.
The datasource dates a release to the day, so a cutoff inside that day may still exclude the upload, and counts as not admitting it.
- tests.test_lint_repo.test_registry_pin_cooldown_passes_on_an_admitting_entry(entries)[source]¶
An entry uv reads as admitting the release lets the install through.
- tests.test_lint_repo.test_registry_pin_cooldown_warns_on_a_pin_no_entry_reaches(tool)[source]¶
A
uvxor npm pin inside the window waits it out, whatever the entries say.The warning names no entry: neither install reads one, so suggesting one would point at a fix that changes nothing.
- tests.test_lint_repo.test_registry_pin_cooldown_passes_past_the_window(tool)[source]¶
A pin past the window installs on every backend, with or without entries.
- tests.test_lint_repo.test_registry_pin_cooldown_skips_an_undated_pin(candidates)[source]¶
A pin the datasource cannot date is indeterminate, never a failure.
- tests.test_lint_repo.test_registry_pin_cooldown_leaves_binary_tools_alone()[source]¶
A binary pin is never looked up: its download applies no cooldown.
- tests.test_lint_repo.test_registry_pin_cooldown_checks_binary_build_tools_where_they_run(name, nuitka_active, checked)[source]¶
A binary build tool’s pin holds back only a project that compiles binaries.
Elsewhere nothing installs the tool, and the entry the warning names would admit a package no job resolves.
- tests.test_lint_repo.test_registry_pin_cooldown_skips_without_a_cooldown()[source]¶
With no window to clear, nothing is held back and nothing is looked up.
- tests.test_lint_repo.test_registry_pin_cooldown_never_fails_the_run()[source]¶
Every registry pin inside the window warns, and
lint-repostill passes.
- tests.test_lint_repo.test_undeclared_labels_detected()[source]¶
Report a label the repository carries that no source declares.
- tests.test_lint_repo.test_undeclared_labels_warns_before_deleting()[source]¶
The finding carries the usage count step, not just the names.
Deleting a label detaches every item carrying it, so a check that only named the orphans would invite exactly the loss it exists to prevent.
- tests.test_lint_repo.test_undeclared_labels_clean()[source]¶
No finding when every label on the repository is declared.
- tests.test_lint_repo.test_undeclared_labels_skips_on_an_unreadable_api()[source]¶
An unreachable API is indeterminate, never a red run.
- tests.test_lint_repo.test_undeclared_labels_is_advisory()[source]¶
The check never fails the command.
A repository may legitimately carry a hand-made label, and deleting one is a judgement call. Both make a red run the wrong answer.
- tests.test_lint_repo.test_declared_labels_are_read_only_when_a_check_asks()[source]¶
Building a context fetches no label definition.
A
labels.extra-filesURL is downloaded to know the declared set, which only the undeclared-labels check needs, and only with a repository.
- tests.test_lint_repo.test_declared_label_names_reads_the_bundled_profiles()[source]¶
The default profile is always read, the awesome one only for a list.
- tests.test_lint_repo.test_declared_labels_follow_the_repository_name()[source]¶
An
awesome-*repository reads the awesome profile too.
- tests.test_lint_repo.test_declared_label_names_excludes_rename_sources()[source]¶
A
rename-fromvalue is not a declaration.It names a label expected to stop existing, so counting it as declared would hide the orphan left behind when the rename does not fire. That is how
meta-package-managercarried📦 dependenciesand its 864 items unreported for six months.
- tests.test_lint_repo.LEMON_CONFIG = {'profiles': {'default': {'labels': [{'color': 'fff44f', 'name': '🍋 lemon'}]}}}¶
One label definition, serialized below into each format
labelmakerreads.
- tests.test_lint_repo.test_names_in_labelmaker_config_reads_every_labelmaker_format(filename, text)[source]¶
Each format
labelmakerreads declares its labels.sync-labelsapplies an extra label file in any of them, so a TOML-only reader would call every label of a JSON or YAML file an orphan.
- tests.test_lint_repo.test_names_in_labelmaker_config_rejects_an_unreadable_file(filename, text)[source]¶
A definition this module cannot read raises instead of declaring nothing.
An empty answer would call every label of that file an orphan.
- tests.test_lint_repo.test_declared_label_names_reads_a_yaml_extra_labels_file(tmp_path)[source]¶
A committed
extra-labels/file counts whatever its format.
- tests.test_lint_repo.REMOTE_LABELS_URL = 'https://example.com/orchard/citrus.toml'¶
A
labels.extra-filesentry, served through a mockedget_bytes.
- tests.test_lint_repo.test_declared_label_names_fetches_remote_extra_files()[source]¶
A
labels.extra-filesdefinition counts without a staged export.lint-repostages nothing, so the declared set reads the file from its URL. Otherwise every label only that file declares would read as an orphan.
- tests.test_lint_repo.test_undeclared_labels_skips_on_an_unusable_extra_file(url, fetch, error)[source]¶
A definition that cannot be fetched or read leaves the check skipped.
A short declared set would call every label of that file an orphan. The set resolves to unknown instead, and the check reports skipped without reading the repository’s labels.