Skip to content

Commit

Permalink
activate checker ingore
Browse files Browse the repository at this point in the history
  • Loading branch information
ysugimoto committed Jan 29, 2025
1 parent a5b58b2 commit 62d0fe1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions cmd/documentation-checker/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ var fastlyVariableCategoryPageUrls = []string{

const predefinedPath = "../../__generator__/predefined.yml"

// Following predefined variables are documented in Fastly docs but actually could not use in VCL statement,
// only could use in an argument of std.count function.
// Following predefined variables are documented in Fastly docs
// but actually could not use in VCL statement, only could use in an argument of `std.count` function.
// Therefore these variables do not treat as lacked variables.
// var ignorePredefinedVariables = map[string]struct{}{
// "req.headers": {},
// "bereq.headers": {},
// "beresp.headers": {},
// "resp.headers": {},
// "obj.headers": {},
// }
var ignorePredefinedVariables = map[string]struct{}{
"req.headers": {},
"bereq.headers": {},
"beresp.headers": {},
"resp.headers": {},
"obj.headers": {},
}

func factoryVariables(ctx context.Context) (*sync.Map, error) {
var eg errgroup.Group
Expand Down Expand Up @@ -75,9 +75,9 @@ func checkVariables(m *sync.Map) ([]Variable, error) {
v := val.(string) //nolint:errcheck

// Check ignore varibles
// if _, ok := ignorePredefinedVariables[k]; ok {
// return true
// }
if _, ok := ignorePredefinedVariables[k]; ok {
return true
}

if _, ok := defined[k]; ok {
return true
Expand Down

0 comments on commit 62d0fe1

Please sign in to comment.