Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] add README to checkapi #38996

Merged
merged 1 commit into from
Mar 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions cmd/checkapi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# CheckAPI

**NOTE: CheckAPI is in development and immature. It is used primarily for opentelemetry-collector-contrib. Contributions are welcome.**

CheckAPI is a go tool that parses the AST tree of a Go module, identifying Golang APIs such as structs and functions
and enforcing rules against them.

This is particularly useful to reduce the API surface of a Go module to a specific set of functions.

## Running CheckAPI

```shell
$> checkapi -folder . -config config.yaml
```

## Configuration

The configuration file is in yaml format:

```yaml
ignored_paths:
- <exact relative paths of Golang modules to ignore>
allowed_functions:
- <at least one function match must be present.>
- name: <name of function>
parameters: <list of parameters by type>
return_types: <list of return types>

ignored_functions:
- <regular expressions of ignored functions. At least one match must be present to ignore the function.>
```