Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Commit

Permalink
Add linter for iterable expressions (DataDog#9956)
Browse files Browse the repository at this point in the history
  • Loading branch information
mx-psi authored Nov 29, 2021
1 parent 836e672 commit be741e9
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 67 deletions.
1 change: 1 addition & 0 deletions .circleci/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
black==21.8b0
codecov==2.1.11
flake8-bugbear==21.4.3
flake8-comprehensions==3.7.0
flake8-unused-arguments==0.0.6
flake8==3.9.2
isort==5.9.3
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ repos:
additional_dependencies:
- flake8-bugbear==21.4.3
- flake8-unused-arguments==0.0.6
- flake8-comprehensions==3.7.0
- repo: https://github.com/psf/black
rev: 21.8b0
hooks:
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ select = B,C,E,F,G,U,W,B001,B003,B006,B007,B301,B305,B306,B902
# - bugbear overlap: E722
# - style options: W2,W3,W50,E111,E114,E117,E12,E2,E3,E5,E74
# - unused argument with underscore: U101
ignore = E203,W2,W3,W50,E111,E114,E117,E12,E2,E3,E5,E74,E722,U101
# - Unnecessary dict call: C408
ignore = E203,W2,W3,W50,E111,E114,E117,E12,E2,E3,E5,E74,E722,U101,C408
exclude = .git,.github,.circleci,chocolatey,docs,google-marketplace,omnibus,pkg-config,releasenotes,vendor,venv,venv3
128 changes: 62 additions & 66 deletions tasks/build_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,104 +7,100 @@

# ALL_TAGS lists all available build tags.
# Used to remove unknown tags from provided tag lists.
ALL_TAGS = set(
[
"android",
"apm",
"clusterchecks",
"consul",
"containerd",
"cri",
"docker",
"ec2",
"etcd",
"fargateprocess",
"gce",
"jmx",
"jetson",
"kubeapiserver",
"kubelet",
"linux_bpf",
"netcgo", # Force the use of the CGO resolver. This will also have the effect of making the binary non-static
"npm",
"orchestrator",
"process",
"python",
"secrets",
"systemd",
"zk",
"zlib",
]
)
ALL_TAGS = {
"android",
"apm",
"clusterchecks",
"consul",
"containerd",
"cri",
"docker",
"ec2",
"etcd",
"fargateprocess",
"gce",
"jmx",
"jetson",
"kubeapiserver",
"kubelet",
"linux_bpf",
"netcgo", # Force the use of the CGO resolver. This will also have the effect of making the binary non-static
"npm",
"orchestrator",
"process",
"python",
"secrets",
"systemd",
"zk",
"zlib",
}

### Tag inclusion lists

# AGENT_TAGS lists the tags needed when building the agent.
AGENT_TAGS = set(
[
"apm",
"consul",
"containerd",
"cri",
"docker",
"ec2",
"etcd",
"gce",
"jetson",
"jmx",
"kubeapiserver",
"kubelet",
"netcgo",
"orchestrator",
"process",
"python",
"secrets",
"systemd",
"zk",
"zlib",
]
)
AGENT_TAGS = {
"apm",
"consul",
"containerd",
"cri",
"docker",
"ec2",
"etcd",
"gce",
"jetson",
"jmx",
"kubeapiserver",
"kubelet",
"netcgo",
"orchestrator",
"process",
"python",
"secrets",
"systemd",
"zk",
"zlib",
}

# ANDROID_TAGS lists the tags needed when building the android agent
ANDROID_TAGS = set(["android", "zlib"])
ANDROID_TAGS = {"android", "zlib"}

# CLUSTER_AGENT_TAGS lists the tags needed when building the cluster-agent
CLUSTER_AGENT_TAGS = set(["clusterchecks", "kubeapiserver", "orchestrator", "secrets", "zlib", "ec2", "gce"])
CLUSTER_AGENT_TAGS = {"clusterchecks", "kubeapiserver", "orchestrator", "secrets", "zlib", "ec2", "gce"}

# CLUSTER_AGENT_CLOUDFOUNDRY_TAGS lists the tags needed when building the cloudfoundry cluster-agent
CLUSTER_AGENT_CLOUDFOUNDRY_TAGS = set(["clusterchecks", "secrets"])
CLUSTER_AGENT_CLOUDFOUNDRY_TAGS = {"clusterchecks", "secrets"}

# DOGSTATSD_TAGS lists the tags needed when building dogstatsd
DOGSTATSD_TAGS = set(["containerd", "docker", "kubelet", "secrets", "zlib"])
DOGSTATSD_TAGS = {"containerd", "docker", "kubelet", "secrets", "zlib"}

# IOT_AGENT_TAGS lists the tags needed when building the IoT agent
IOT_AGENT_TAGS = set(["jetson", "systemd", "zlib"])
IOT_AGENT_TAGS = {"jetson", "systemd", "zlib"}

# PROCESS_AGENT_TAGS lists the tags necessary to build the process-agent
PROCESS_AGENT_TAGS = AGENT_TAGS.union(set(["clusterchecks", "fargateprocess", "orchestrator"]))
PROCESS_AGENT_TAGS = AGENT_TAGS.union({"clusterchecks", "fargateprocess", "orchestrator"})

# SECURITY_AGENT_TAGS lists the tags necessary to build the security agent
SECURITY_AGENT_TAGS = set(["netcgo", "secrets", "docker", "containerd", "kubeapiserver", "kubelet"])
SECURITY_AGENT_TAGS = {"netcgo", "secrets", "docker", "containerd", "kubeapiserver", "kubelet"}

# SYSTEM_PROBE_TAGS lists the tags necessary to build system-probe
SYSTEM_PROBE_TAGS = AGENT_TAGS.union(set(["clusterchecks", "linux_bpf", "npm"]))
SYSTEM_PROBE_TAGS = AGENT_TAGS.union({"clusterchecks", "linux_bpf", "npm"})

# TRACE_AGENT_TAGS lists the tags that have to be added when the trace-agent
TRACE_AGENT_TAGS = set(["docker", "containerd", "kubeapiserver", "kubelet", "netcgo", "secrets"])
TRACE_AGENT_TAGS = {"docker", "containerd", "kubeapiserver", "kubelet", "netcgo", "secrets"}

# TEST_TAGS lists the tags that have to be added to run tests
TEST_TAGS = AGENT_TAGS.union(set(["clusterchecks"]))
TEST_TAGS = AGENT_TAGS.union({"clusterchecks"})

### Tag exclusion lists

# List of tags to always remove when not building on Linux
LINUX_ONLY_TAGS = set(["cri", "netcgo", "systemd", "jetson", "linux_bpf"])
LINUX_ONLY_TAGS = {"cri", "netcgo", "systemd", "jetson", "linux_bpf"}

# List of tags to always remove when building on Windows
WINDOWS_EXCLUDE_TAGS = set(["linux_bpf"])
WINDOWS_EXCLUDE_TAGS = {"linux_bpf"}

# List of tags to always remove when building on Windows 32-bits
WINDOWS_32BIT_EXCLUDE_TAGS = set(["docker", "kubeapiserver", "kubelet", "orchestrator"])
WINDOWS_32BIT_EXCLUDE_TAGS = {"docker", "kubeapiserver", "kubelet", "orchestrator"}

# Build type: build tags map
build_tags = {
Expand Down

0 comments on commit be741e9

Please sign in to comment.