_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c178300
test
// Save writes the build file to disk. This method calls Sync internally.
{ "resource": "" }
c178301
test
// HasDefaultVisibility returns whether the File contains a "package" rule with // a "default_visibility" attribute. Rules generated by Gazelle should not // have their own visibility attributes if this is the case.
{ "resource": "" }
c178302
test
// NewLoad creates a new, empty load statement for the given file name.
{ "resource": "" }
c178303
test
// Symbols returns a list of symbols this statement loads.
{ "resource": "" }
c178304
test
// Has returns true if sym is loaded by this statement.
{ "resource": "" }
c178305
test
// Add inserts a new symbol into the load statement. This has no effect if // the symbol is already loaded. Symbols will be sorted, so the order // doesn't matter.
{ "resource": "" }
c178306
test
// Remove deletes a symbol from the load statement. This has no effect if // the symbol is not loaded.
{ "resource": "" }
c178307
test
// Insert marks this statement for insertion at the given index. If multiple // statements are inserted at the same index, they will be inserted in the // order Insert is called.
{ "resource": "" }
c178308
test
// NewRule creates a new, empty rule with the given kind and name.
{ "resource": "" }
c178309
test
// SetKind changes the kind of rule this is.
{ "resource": "" }
c178310
test
// AttrKeys returns a sorted list of attribute keys used in this rule.
{ "resource": "" }
c178311
test
// Attr returns the value of the named attribute. nil is returned when the // attribute is not set.
{ "resource": "" }
c178312
test
// AttrString returns the value of the named attribute if it is a scalar string. // "" is returned if the attribute is not set or is not a string.
{ "resource": "" }
c178313
test
// AttrStrings returns the string values of an attribute if it is a list. // nil is returned if the attribute is not set or is not a list. Non-string // values within the list won't be returned.
{ "resource": "" }
c178314
test
// DelAttr removes the named attribute from the rule.
{ "resource": "" }
c178315
test
// SetAttr adds or replaces the named attribute with an expression produced // by ExprFromValue.
{ "resource": "" }
c178316
test
// PrivateAttrKeys returns a sorted list of private attribute names.
{ "resource": "" }
c178317
test
// SetPrivateAttr associates a value with a key. Unlike SetAttr, this value // is not converted to a build syntax tree and will not be written to a build // file.
{ "resource": "" }
c178318
test
// Insert marks this statement for insertion at the end of the file. Multiple // statements will be inserted in the order Insert is called.
{ "resource": "" }
c178319
test
// IsEmpty returns true when the rule contains none of the attributes in attrs // for its kind. attrs should contain attributes that make the rule buildable // like srcs or deps and not descriptive attributes like name or visibility.
{ "resource": "" }
c178320
test
// CheckInternalVisibility overrides the given visibility if the package is // internal.
{ "resource": "" }
c178321
test
// New constructs a new label from components.
{ "resource": "" }
c178322
test
// Rel attempts to compute a relative label from this label. If this label // is already relative or is in a different package, this label may be // returned unchanged.
{ "resource": "" }
c178323
test
// Equal returns whether two labels are exactly the same. It does not return // true for different labels that refer to the same target.
{ "resource": "" }
c178324
test
// Contains returns whether other is contained by the package of l or a // sub-package. Neither label may be relative.
{ "resource": "" }
c178325
test
// // Process -go_googleapis case //
{ "resource": "" }
c178326
test
// shouldCall returns true if Walk should call the callback in the // directory rel.
{ "resource": "" }
c178327
test
// shouldUpdate returns true if Walk should pass true to the callback's update // parameter in the directory rel. This indicates the build file should be // updated.
{ "resource": "" }
c178328
test
// shouldVisit returns true if Walk should visit the subdirectory rel.
{ "resource": "" }
c178329
test
// SquashRules copies information from src into dst without discarding // information in dst. SquashRules detects duplicate elements in lists and // dictionaries, but it doesn't sort elements after squashing. If squashing // fails because the expression is not understood, an error is returned, // and neither rule is mo...
{ "resource": "" }
c178330
test
// runClient performs the main work of the client. It attempts to connect // to the server via a UNIX-domain socket. If the server is not running, // it starts the server and tries again. The server does all the work, so // the client just waits for the server to complete, then exits.
{ "resource": "" }
c178331
test
// UpdateRepo returns an object describing a repository at the most recent // commit or version tag. // // This function uses RemoteCache to retrieve information about the repository. // Depending on how the RemoteCache was initialized and used earlier, some // information may already be locally available. Frequently t...
{ "resource": "" }
c178332
test
// NewRemoteCache creates a new RemoteCache with a set of known repositories. // The Root and Remote methods will return information about repositories listed // here without accessing the network. However, the Head method will still // access the network for these repositories to retrieve information about new // vers...
{ "resource": "" }
c178333
test
// Remote returns the VCS name and the remote URL for a repository with the // given root import path. This is suitable for creating new repository rules.
{ "resource": "" }
c178334
test
// get retrieves a value associated with the given key from the cache. ok will // be true if the key exists in the cache, even if it's in the process of // being fetched.
{ "resource": "" }
c178335
test
// ensure retreives a value associated with the given key from the cache. If // the key does not exist in the cache, the load function will be called, // and its result will be associated with the key. The load function will not // be called more than once for any key.
{ "resource": "" }
c178336
test
// RelBaseName returns the base name for rel, a slash-separated path relative // to the repository root. If rel is empty, RelBaseName returns the base name // of prefix. If prefix is empty, RelBaseName returns the base name of root, // the absolute file path of the repository root directory. If that's empty // to, then...
{ "resource": "" }
c178337
test
// Clone creates a copy of the configuration for use in a subdirectory. // Note that the Exts map is copied, but its contents are not. // Configurer.Configure should do this, if needed.
{ "resource": "" }
c178338
test
// IsValidBuildFileName returns true if a file with the given base name // should be treated as a build file.
{ "resource": "" }
c178339
test
// check returns true if at least one of the tag groups is satisfied.
{ "resource": "" }
c178340
test
// fileNameInfo returns information that can be inferred from the name of // a file. It does not read data from the file.
{ "resource": "" }
c178341
test
// otherFileInfo returns information about a non-.go file. It will parse // part of the file to determine build tags. If the file can't be read, an // error will be logged, and partial information will be returned.
{ "resource": "" }
c178342
test
// protoFileInfo extracts metadata from a proto file. The proto extension // already "parses" these and stores metadata in proto.FileInfo, so this is // just processing relevant options.
{ "resource": "" }
c178343
test
// AddRule adds a rule r to the index. The rule will only be indexed if there // is a known resolver for the rule's kind and Resolver.Imports returns a // non-nil slice. // // AddRule may only be called before Finish.
{ "resource": "" }
c178344
test
// Finish constructs the import index and performs any other necessary indexing // actions after all rules have been added. This step is necessary because // a rule may be indexed differently based on what rules are added later. // // Finish must be called after all AddRule calls and before any // FindRulesByImport cal...
{ "resource": "" }
c178345
test
// buildImportIndex constructs the map used by FindRulesByImport.
{ "resource": "" }
c178346
test
// IsSelfImport returns true if the result's label matches the given label // or the result's rule transitively embeds the rule with the given label. // Self imports cause cyclic dependencies, so the caller may want to omit // the dependency or report an error.
{ "resource": "" }
c178347
test
// applyKindMappings returns a copy of LoadInfo that includes c.KindMap.
{ "resource": "" }
c178348
test
// appendOrMergeKindMapping adds LoadInfo for the given replacement.
{ "resource": "" }
c178349
test
// RuleName returns a name for a proto_library derived from the given strings. // For each string, RuleName will look for a non-empty suffix of identifier // characters and then append "_proto" to that.
{ "resource": "" }
c178350
test
// buildPackage extracts metadata from the .proto files in a directory and // constructs possibly several packages, then selects a package to generate // a proto_library rule for.
{ "resource": "" }
c178351
test
// selectPackage chooses a package to generate rules for.
{ "resource": "" }
c178352
test
// generateProto creates a new proto_library rule for a package. The rule may // be empty if there are no sources.
{ "resource": "" }
c178353
test
// generateEmpty generates a list of proto_library rules that may be deleted. // This is generated from existing proto_library rules with srcs lists that // don't match any static or generated files.
{ "resource": "" }
c178354
test
// ImportRepoRules reads the lock file of a vendoring tool and returns // a list of equivalent repository rules that can be merged into a WORKSPACE // file. The format of the file is inferred from its basename.
{ "resource": "" }
c178355
test
// MergeRules merges a list of generated repo rules with the already defined repo rules, // and then updates each rule's underlying file. If the generated rule matches an existing // one, then it inherits the file where the existing rule was defined. If the rule is new then // its file is set as the destFile parameter....
{ "resource": "" }
c178356
test
// GenerateRule returns a repository rule for the given repository that can // be written in a WORKSPACE file.
{ "resource": "" }
c178357
test
// FindExternalRepo attempts to locate the directory where Bazel has fetched // the external repository with the given name. An error is returned if the // repository directory cannot be located.
{ "resource": "" }
c178358
test
// ListRepositories extracts metadata about repositories declared in a // file.
{ "resource": "" }
c178359
test
// migrateLibraryEmbed converts "library" attributes to "embed" attributes, // preserving comments. This only applies to Go rules, and only if there is // no keep comment on "library" and no existing "embed" attribute.
{ "resource": "" }
c178360
test
// migrateGrpcCompilers converts "go_grpc_library" rules into "go_proto_library" // rules with a "compilers" attribute.
{ "resource": "" }
c178361
test
// squashCgoLibrary removes cgo_library rules with the default name and // merges their attributes with go_library with the default name. If no // go_library rule exists, a new one will be created. // // Note that the library attribute is disregarded, so cgo_library and // go_library attributes will be squashed even if...
{ "resource": "" }
c178362
test
// removeLegacyProto removes uses of the old proto rules. It deletes loads // from go_proto_library.bzl. It deletes proto filegroups. It removes // go_proto_library attributes which are no longer recognized. New rules // are generated in place of the deleted rules, but attributes and comments // are not migrated.
{ "resource": "" }
c178363
test
// removeLegacyGazelle removes loads of the "gazelle" macro from // @io_bazel_rules_go//go:def.bzl. The definition has moved to // @bazel_gazelle//:def.bzl, and the old one will be deleted soon.
{ "resource": "" }
c178364
test
// selectPackages selects one Go packages out of the buildable packages found // in a directory. If multiple packages are found, it returns the package // whose name matches the directory if such a package exists.
{ "resource": "" }
c178365
test
// AddBuiltin registers a builtin kind with its info.
{ "resource": "" }
c178366
test
// MappedKind records the fact that the given mapping was applied while // processing the given package.
{ "resource": "" }
c178367
test
// Resolver returns a resolver for the given rule and package, and a bool // indicating whether one was found. Empty string may be passed for pkgRel, // which results in consulting the builtin kinds only.
{ "resource": "" }
c178368
test
// sortExprLabels sorts lists of strings using the same order as buildifier. // Buildifier also sorts string lists, but not those involved with "select" // expressions. This function is intended to be used with bzl.Walk.
{ "resource": "" }
c178369
test
// checkRulesGoVersion checks whether a compatible version of rules_go is // being used in the workspace. A message will be logged if an incompatible // version is found. // // Note that we can't always determine the version of rules_go in use. Also, // if we find an incompatible version, we shouldn't bail out since th...
{ "resource": "" }
c178370
test
// preprocessTags adds some tags which are on by default before they are // used to match files.
{ "resource": "" }
c178371
test
// setBuildTags sets genericTags by parsing as a comma separated list. An // error will be returned for tags that wouldn't be recognized by "go build". // preprocessTags should be called before this.
{ "resource": "" }
c178372
test
// splitDirective splits a comma-separated directive value into its component // parts, trimming each of any whitespace characters.
{ "resource": "" }
c178373
test
// copyGoModToTemp copies to given go.mod file to a temporary directory. // go list tends to mutate go.mod files, but gazelle shouldn't do that.
{ "resource": "" }
c178374
test
// findGoTool attempts to locate the go executable. If GOROOT is set, we'll // prefer the one in there; otherwise, we'll rely on PATH. If the wrapper // script generated by the gazelle rule is invoked by Bazel, it will set // GOROOT to the configured SDK. We don't want to rely on the host SDK in // that situation.
{ "resource": "" }
c178375
test
// isBuildable returns true if anything in the package is buildable. // This is true if the package has Go code that satisfies build constraints // on any platform or has proto files not in legacy mode.
{ "resource": "" }
c178376
test
// startServer starts a new server process. This is called by the client.
{ "resource": "" }
c178377
test
// watchDir listens for file system changes in root and its // subdirectories. The record function is called with directories whose // contents have changed. New directories are watched recursively. // The returned cancel function may be called to stop watching.
{ "resource": "" }
c178378
test
// listDirs returns a slice containing all the subdirectories under dir, // including dir itself.
{ "resource": "" }
c178379
test
// shouldIgnore returns whether a write to the given file should be ignored // because they were caused by gazelle or autogazelle or something unrelated // to the build.
{ "resource": "" }
c178380
test
// recordWrite records that a directory has been modified and that its build // file should be updated the next time gazelle runs.
{ "resource": "" }
c178381
test
// getAndClearWrittenDirs retrieves a list of directories that have been // modified since the last time getAndClearWrittenDirs was called.
{ "resource": "" }
c178382
test
//CombineHandler takes variadic list of handlers and produces one handler //that calls each handler in order.
{ "resource": "" }
c178383
test
//VerifyContentType returns a handler that verifies that a request has a Content-Type header set to the //specified value
{ "resource": "" }
c178384
test
//VerifyMimeType returns a handler that verifies that a request has a specified mime type set //in Content-Type header
{ "resource": "" }
c178385
test
//VerifyBasicAuth returns a handler that verifies the request contains a BasicAuth Authorization header //matching the passed in username and password
{ "resource": "" }
c178386
test
//VerifyJSONRepresenting is similar to VerifyJSON. Instead of taking a JSON string, however, it //takes an arbitrary JSON-encodable object and verifies that the requests's body is a JSON representation //that matches the object
{ "resource": "" }
c178387
test
//VerifyFormKV returns a handler that verifies a request contains a form key with the specified values. // //It is a convenience wrapper around `VerifyForm` that lets you avoid having to create a `url.Values` object.
{ "resource": "" }
c178388
test
//RespondWithProto returns a handler that responds to a request with the specified status code and a body //containing the protobuf serialization of the provided message. // //Also, RespondWithProto can be given an optional http.Header. The headers defined therein will be added to the response headers.
{ "resource": "" }
c178389
test
// RegisterFailHandlerWithT ensures that the given types.TWithHelper and fail handler // are used globally.
{ "resource": "" }
c178390
test
// EventuallyWithOffset operates like Eventually but takes an additional // initial argument to indicate an offset in the call stack. This is useful when building helper // functions that contain matchers. To learn more, read about `ExpectWithOffset`.
{ "resource": "" }
c178391
test
// ConsistentlyWithOffset operates like Consistnetly but takes an additional // initial argument to indicate an offset in the call stack. This is useful when building helper // functions that contain matchers. To learn more, read about `ExpectWithOffset`.
{ "resource": "" }
c178392
test
// Expect is used to make assertions. See documentation for Expect.
{ "resource": "" }
c178393
test
// Eventually is used to make asynchronous assertions. See documentation for Eventually.
{ "resource": "" }
c178394
test
// Consistently is used to make asynchronous assertions. See documentation for Consistently.
{ "resource": "" }
c178395
test
// TimeoutCloser returns an io.Closer that wraps the passed-in io.Closer. If the underlying Closer fails to close within the alloted timeout ErrTimeout is returned.
{ "resource": "" }
c178396
test
// TimeoutReader returns an io.Reader that wraps the passed-in io.Reader. If the underlying Reader fails to read within the alloted timeout ErrTimeout is returned.
{ "resource": "" }
c178397
test
// TimeoutWriter returns an io.Writer that wraps the passed-in io.Writer. If the underlying Writer fails to write within the alloted timeout ErrTimeout is returned.
{ "resource": "" }
c178398
test
// Create a NestedError with the given path. // If err is a NestedError, prepend the path to it. // If err is an AggregateError, recursively Nest each error.
{ "resource": "" }
c178399
test
// SetMockService return a new MockService and set as a servicemanager
{ "resource": "" }