Skip to content

refactor(compact-lint): read the [lint] table of compact.toml - #190

Merged
0xisk merged 1 commit into
feat/compact-lint-diagnosticsfrom
refactor/compact-lint-compact-toml
Sep 15, 2026
Merged

0xisk merged 1 commit into
feat/compact-lint-diagnosticsfrom
refactor/compact-lint-compact-toml

Conversation

@0xisk

@0xisk 0xisk commented Sep 15, 2026

Copy link
Copy Markdown
Member

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Depends on #189, merge after.

compact-deploy and compact-lint each read a project TOML. This makes it one file, compact.toml, with the linter under [lint] and the deployer's tables untouched.

Not visible in the diff:

  • The deployer needs no code change. Its Zod root object is not .strict(), so it already drops a [lint] table. The new deployer test exists to keep that true.
  • The linter parses the whole document without deny_unknown_fields at the root and keeps it inside [lint], so a typo under the linter's own table is still rejected while foreign tables pass.
  • version = 1 is gone. Nothing shipped with it, and the deployer's half of the file has no version key.
  • The 28 fixture configs moved with git mv and were rewritten by script; no expected*.txt changed, which is the proof the rename is behaviour-neutral.
  • If Midnight's own compact CLI ever claims compact.toml, [lint] survives as a namespace. The deployer's bare [networks]/[contracts] tables would not, and moving them is a separate decision.

Start with crates/compact-lint/src/config.rs (Document wrapper, MissingLintTable).

PR Checklist

  • I have read the Contributing Guide
  • I have added tests that prove my fix is effective or that my feature works
  • I have added documentation of new methods and any new behavior or changes to existing behavior
  • CI Workflows Are Passing

One project, one config file. compact-deploy already owns
`compact.toml`, so the linter moves its settings under a `[lint]`
table there and `compact-lint.toml` goes away before anything ships.

* The linter parses the whole document but deserialises only `lint`;
  every other table is another tool's and is ignored. A file with no
  `[lint]` table is a config error, no file at all keeps the built-in
  defaults.
* The `version` key is dropped: tables are namespaced per tool and the
  deployer's file has none either.
* A deployer test pins that its loader strips the `[lint]` table, so
  the two tools keep sharing the file without a schema change.
@0xisk
0xisk requested review from a team as code owners September 15, 2026 14:45
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 9cff4551-bf21-4c27-a539-b7ec099f3165

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@0xisk
0xisk merged commit 3f722cb into feat/compact-lint-diagnostics Sep 15, 2026
8 checks passed
@0xisk
0xisk deleted the refactor/compact-lint-compact-toml branch September 15, 2026 14:56
@0xisk

0xisk commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

Folded into #189 as its second commit (3f722cb) to keep the stack short; GitHub marked this merged when the base branch took the commit.

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.

1 participant