ZMK.COVERITY(5)

πŸ’– zmk.Coverity(5) πŸ’–

okay so bestie, welcome to zmk.Coverity, section 5 of the manual β€” yes she's a file format / module page, and yes she's iconic. this is the Coverity module: it's how you talk to the Coverity static analysis tool without losing your mind. let's get into it πŸ’…


✨ NAME ✨

Coverity β€” a module for interacting with the Coverity static analysis tool. that's it, that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

include z.mk
# additional definitions required
$(eval $(call ZMK.Import,Coverity))

so you include z.mk first, then there's additional definitions required (aka the variables down below, don't skip them, i'm begging πŸ₯Ί), and then you import the module with that $(eval $(call ZMK.Import,Coverity)) line. no cap, that eval-call combo is doing the heavy lifting. πŸ‘‘


πŸ’« DESCRIPTION πŸ’«

the Coverity module lets you prepare and upload scan artifacts to a hosted Coverity instance. that's the whole job. she preps, she ships, she slays. ✨


πŸŽ€ TARGETS πŸŽ€

this module hands you the following targets. main character energy, every single one.

🌈 upload-coverity-scan

this phony target uses curl to upload the archived scan artifacts to the coverity scanning service. it's giving "just send it" πŸ“€πŸ’–

🌈 clean

this phony target removes the cov-int directory as well as the cov-int.$(NAME)-$(VERSION).tar.gz archive. both. gone. so satisfying honestly 🧹✨

🌈 cov-int

this target invokes the cov-build program to forcibly re-build the whole project and collect information for analysis. forcibly. she said what she said. πŸ’ͺ

🌈 cov-int.$(NAME)-$(VERSION).tar.gz

this target archives the cov-int directory. zip zip, tarball, done. 🎁


πŸ¦‹ VARIABLES πŸ¦‹

this module provides the following variables. heads up bestie: four of these have no default value, which means you must set them before importing the module. no setting, no slay. 😀

  • Coverity.Sources β€” list of source files to consider as analysis dependency.
there is no default value. this variable must be set before importing the module.
  • Coverity.ProjectName β€” name of the project registered on the Coverity instance.
there is no default value. this variable must be set before importing the module.
  • Coverity.Email β€” e-mail address of the project maintainer, as registered on the Coverity instance.
there is no default value. this variable must be set before importing the module.
  • Coverity.Token β€” the token used to authorize uploads of scan artifacts.
there is no default value. this variable must be set before importing the module.
  • Coverity.ScanURL β€” the URL used for submitting scan artifacts.
the default value is https://scan.coverity.com/builds β€” yes queen, this one has a default πŸŽ€

πŸ’€ BUGS πŸ’€

this module uses recursive make invocation and is therefore not safe to execute concurrently with other scanners that use this strategy. fr fr, don't run her in parallel with her siblings, it goes bad. πŸ™ˆ


🌟 EXAMPLES 🌟

here's the cute little demo: how Coverity can be used to scan a sample project. the code assumes that your local installation of the coverity scanner lives in /opt/cov-analysis-linux64-2019.03. the project name and maintainer email are provided in-line, but the authentication token is expected to come from the environment variable COVERITY_TOKEN. iykyk πŸ”

include z.mk
COVERITY_TOKEN ?=
ifneq (,$(COVERITY_TOKEN))  # enable coverity if secret token is available
Coverity.Sources=foo.c
Coverity.ProjectName=foo
Coverity.Email=maintainer@example.com
Coverity.Token=$(COVERITY_TOKEN)
cov-int: PATH := $(PATH):/opt/cov-analysis-linux64-2019.03/bin
$(eval $(call ZMK.Import,Coverity))
endif

see how the whole thing is wrapped in that ifneq? that's the "only turn her on if the secret token is available" move. obsessed. πŸ’–


πŸ“œ HISTORY πŸ“œ

the Coverity module first appeared in zmk 0.1. she's been here since day one, a true veteran. πŸ‘‘


πŸ‘‘ AUTHORS πŸ‘‘

Zygmunt Krynicki <me@zygoon.pl> β€” thank you for the module king 🫢


and that's the whole page bestie!! this lil manual is from zmk 0.5.1, dated Jan 8 2021, and it's the zmk.Coverity(5) page. now go set those variables before you import, or she will simply not work πŸ’…βœ¨πŸ’–