Skip to content

Introduce a apitool CLI for the substrate API. - #1162

Open
Julian Gutierrez Oschmann (juli4n) wants to merge 1 commit into
agent-substrate:mainfrom
juli4n:apitool_linter
Open

Introduce a apitool CLI for the substrate API.#1162
Julian Gutierrez Oschmann (juli4n) wants to merge 1 commit into
agent-substrate:mainfrom
juli4n:apitool_linter

Conversation

@juli4n

@juli4n Julian Gutierrez Oschmann (juli4n) commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

The idea is to bundle automation related to the API here. For now, there is only a single validate command that runs a set of lint rules to enforce that the API adheres to the style guide. This should help us prevent regressions / deviations when modifying it.

These are not enforced as part of the presubmit checks, although we might want to enforce that soon (right after we close the existing gaps? see #1163). There is no support for violation exemptions for now.

In the future, we could add another command to, for example, generate a reference documentation for the whole API.

Comment thread tools/apitool/internal/cmd/root.go
The idea is to bundle automation related to the API here. Initially,
there is only a single `validate` command to run a set of lint rules
that enforce that the API adheres to the style guide. This should help
us prevent regressions / deviations when adding features.

The linter generates validation errors today, so we are not enforcing
this as part of the presubmit checks. Although we might want to enforce that
soon, once we fix the errors.

There is no support for violation exemptions for now.

In the future, we could add another command to, for example, generate
a reference documentation for the whole API.
Comment thread tools/apitool/README.md
The `apitool` is a CLI that automates tasks related to the Substrate API.

The only command it has today is a command to run a set of validations that enforce
that the API adheres to the Substrate API style guide.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to add a verify script to enforce it?

@BenTheElder

Copy link
Copy Markdown
Collaborator

These are not enforced as part of the presubmit checks, although we might want to enforce that soon (right after we close the existing gaps? see #1163). There is no support for violation exemptions for now.

We should add even just a hardcoded exception list that will be removed over time, so there doesn't need to be a concept in the future to allow this, but so we can start ratcheting fixes?

Doing everything in bulk is harder.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't help but feel like there's a lot of repetitive and verbose code looking for a better abstraction but I'd need more time to think about how we might approach that

golangci-lint like kube-api-linter perhaps

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.

2 participants