Bazel Concepts: Difference between revisions
(→nogo) |
(→nogo) |
||
Line 109: | Line 109: | ||
<font color=darkkhaki>TODO: https://blog.bazel.build/2019/09/29/intellij-bazel-sync.html</font> | <font color=darkkhaki>TODO: https://blog.bazel.build/2019/09/29/intellij-bazel-sync.html</font> | ||
=<tt>nogo</tt>= | =<tt>rules_go</tt>= | ||
==<tt>nogo</tt>== | |||
{{External|https://github.com/bazelbuild/rules_go/blob/master/go/nogo.rst#}} | {{External|https://github.com/bazelbuild/rules_go/blob/master/go/nogo.rst#}} | ||
<code>nogo</code> is a tool that analyzes source code of Go programs. It runs alongside the Go compiler in the Bazel Go rules and rejects programs that contain disallowing coding patterns. In addition, <code>nogo</code> may report compiler-like errors. It is configured with a JSON file that specifies [[#Analyzer|analyzers]]: | <code>nogo</code> is a tool that analyzes source code of Go programs. It runs alongside the Go compiler in the Bazel Go rules and rejects programs that contain disallowing coding patterns. In addition, <code>nogo</code> may report compiler-like errors. It is configured with a JSON file that specifies [[#Analyzer|analyzers]]: | ||
Line 131: | Line 132: | ||
===Analyzers=== | ===Analyzers=== | ||
{{External|https://github.com/bazelbuild/rules_go/blob/master/go/nogo.rst#configuring-analyzers}} | {{External|https://github.com/bazelbuild/rules_go/blob/master/go/nogo.rst#configuring-analyzers}} | ||
=<tt>gazelle</tt>= |
Revision as of 19:23, 10 August 2024
Internal
Repository
repositories.bzl
Package
Target
Label
BUILD files
Dependencies
Build Dependency Graph
Also see:
Visibility
Platforms
Rules
Hermeticity
Directories
Workspace
A project's workspace is the directory where bazel looks for build inputs and BUILD
files, and where it stores build outputs. The actual location is obtained with bazel info
.
Bin
The actual location is obtained with bazel info
.
Genfiles
The actual location is obtained with bazel info
.
Testlogs
The actual location is obtained with bazel info
.
Execution Root
The actual location is obtained with bazel info
.
Install Base
The actual location is obtained with bazel info
.
Output Base
The actual location is obtained with bazel info
.
Output Path
The actual location is obtained with bazel info
.
Package Path
%workspace%
. See Workspace.
Repository Cache
The actual location is obtained with bazel info
.
Files
Server Log
The actual location is obtained with bazel info
.
Command Log
The actual location is obtained with bazel info
.
.bazelrc
Project View File
Seems to be this one:
directories: # Add the directories you want added as source here # By default, we've added your entire workspace ('.') . # Automatically includes all relevant targets under the 'directories' above derive_targets_from_directories: true targets: # If source code isn't resolving, add additional targets that compile it here additional_languages: # Uncomment any additional languages you want supported # android # dart # go # javascript # kotlin # python # scala # typescript # Uncomment to run this target before every sync # gazelle_target: //:gazelle
BUILD File
Starlark
Bazelisk
A bazel runner. as "Bazel binary location" in the Bazel IntelliJ Plugin.
Bazel and IntelliJ
Sync Process
The sync process queries Bazel for information and builds IntelliJ project structure to fid Bazel's model. It runs automatically during a project import, and manually by clicking on the sync icon in the menu bar, or partially syncing packages and individual files in contextual menus.
If the file is not reachable from Bazel targets, it will show up as unsynced in the IDE.
TODO: https://blog.bazel.build/2019/09/29/intellij-bazel-sync.html
rules_go
nogo
nogo
is a tool that analyzes source code of Go programs. It runs alongside the Go compiler in the Bazel Go rules and rejects programs that contain disallowing coding patterns. In addition, nogo
may report compiler-like errors. It is configured with a JSON file that specifies analyzers:
{
"structtag": {
"exclude_files": {
"vendor/": "vendor tools don't pass vet",
"external/": "external tools don't pass vet"
}
},
"exhaustive": {
"exclude_files": {
"vendor/": "vendor tools don't pass vet",
"external/": "external tools don't pass vet"
}
},
...
}