config

package
v1.2.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

TODO: Temporary fork of banncheck from https://github.com/google/go-safeweb/tree/eb79df54b8bc1910ac3bc3fc3328da7c0fb016e1/cmd/bancheck

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BannedAPI

type BannedAPI struct {
	Name       string      `json:"name"` // fully qualified identifier name
	Msg        string      `json:"msg"`  // additional information e.g. rationale for banning
	Exemptions []Exemption `json:"exemptions"`
}

BannedAPI represents an identifier (e.g. import, function call) that should not be used.

type Config

type Config struct {
	Imports   []BannedAPI `json:"imports"`
	Functions []BannedAPI `json:"functions"`
}

Config represents a configuration passed to the linter.

func ReadConfigs

func ReadConfigs(configFS fs.FS, files []string) (*Config, error)

ReadConfigs reads banned APIs from all files.

type Exemption

type Exemption struct {
	Justification string `json:"justification"`
	AllowedPkg    string `json:"allowedPkg"` // Uses Go RegExp https://golang.org/pkg/regexp/syntax
}

Exemption represents a location that should be exempted from checking for banned APIs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL