10 Commits

Author SHA1 Message Date
kevinstyra 94a953150a cmd: allow branding
This change allows users that build their own executable or "spin" of
OPA to give it a name, and have it reference itself properly in help
texts.

It's a vanity thing, but I think some people would appreciate it, hat
tip to the international association of pedants.

Signed-off-by: Stephan Renatus <stephan@styra.com>
Co-authored-by: kevinstyra <83973046+kevinstyra@users.noreply.github.com>
2025-07-24 11:33:23 +02:00
Charlie Egan b0cd306a7f docs: Fix CLI documentation generation (#7600)
The new command is based on generating JSON for docusaurus consumption
rather than markdown. This is less error prone as manipulation of
markdown is better contained.

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-05-20 11:21:10 +01:00
Anders Eknert afb30d3f9d Add gocritic linter, fix a bunch of stuff (#7377)
Brace yourselves! For there are many touched files here. No changes
in semantics however.

Spent a long time trying out the various optional rules gocritic
provides, and settled for a few of them. There are more I really
like, but that would take many hours to address across the codebase.

Perhaps others find gocritic too pedantic? If so, we can merge the
fixes without enabling the rule.

Signed-off-by: Anders Eknert <anders@styra.com>
2025-02-24 16:28:41 +01:00
Anders Eknert 55e87e79ae Add perfsprint linter (#7334)
And update code to conform to the rule.

- Replace unnecessary fmt.Sprintf with string concatenation
- Replace fmt.Sprint with more efficient strconv.Itoa
- Replace static fmt.Errorf calls with more efficient errors.New

Thanks @srenatus for pushing me down this rabbit hole!

Signed-off-by: Anders Eknert <anders@styra.com>
2025-01-31 20:24:05 +01:00
Anders Eknert 92a4d1fb9e Add some docs on using env vars in place of CLI flags (#6631)
Not sure where to put this really as we don't have much in terms of docs
on the CLI outside of the generated ones. If there are more places where
this could be mentioned, let me know and I'll add it there too.

Signed-off-by: Anders Eknert <anders@styra.com>
2024-03-15 10:59:44 +01:00
Eng Zer Jun b3ae18d3a3 perf: avoid unnecessary byte/string conversion
We can use alternative functions/methods to avoid unnecessary
byte/string conversion calls.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-05-23 10:00:59 -07:00
Anders Eknert 9a597feb2e chore: don't use the deprecated ioutil functions (#5319)
Another annoyance removed :P

Signed-off-by: Anders Eknert <anders@eknert.com>
2022-10-27 14:30:26 +02:00
Philip Conrad b2d92a33c1 Add prealloc linter check + linter fixes (#5139)
This commit adds the `prealloc` linter to the list of linters for OPA, and fixes up the miscellaneous locations in the code that the linter found where we could easily preallocate slices.

Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
2022-09-15 15:09:54 -04:00
Stephan Renatus 1f01a2666c docs: de-evaluate $HOME in CLI docs (#4256)
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2022-01-20 11:29:05 +01:00
Anders Eknert f272af65f6 Add CLI section to docs (#4241)
Fixes #3915

Signed-off-by: Anders Eknert <anders@eknert.com>
2022-01-19 13:00:09 +01:00