Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into security-policy-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
meatballhat committed May 7, 2022
2 parents 1bef031 + c6f7393 commit 31d6090
Show file tree
Hide file tree
Showing 61 changed files with 6,996 additions and 1,067 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,18 @@ jobs:
- name: vet
run: go run internal/build/build.go vet

- name: test with tags
run: go run internal/build/build.go -tags urfave_cli_no_docs test

- name: test
run: go run internal/build/build.go test

- name: check-binary-size
run: go run internal/build/build.go check-binary-size

- name: check-binary-size with tags (informational only)
run: go run internal/build/build.go -tags urfave_cli_no_docs check-binary-size || true

- name: Upload coverage to Codecov
if: success() && matrix.go == '1.18.x' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v2
Expand Down Expand Up @@ -81,3 +87,8 @@ jobs:

- name: toc
run: go run internal/build/build.go toc docs/v2/manual.md

- name: diff check
run: |
git diff --exit-code
git diff --cached --exit-code
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016 Jeremy Saenz & Contributors
Copyright (c) 2022 urfave/cli maintainers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# NOTE: this Makefile is meant to provide a simplified entry point for humans to
# run all of the critical steps to verify one's changes are harmonious in
# nature. Keeping target bodies to one line each and abstaining from make magic
# are very important so that maintainers and contributors can focus their
# attention on files that are primarily Go.

.PHONY: all
all: generate vet tag-test test check-binary-size tag-check-binary-size gfmrun toc v2diff

# NOTE: this is a special catch-all rule to run any of the commands
# defined in internal/build/build.go with optional arguments passed
# via GFLAGS (global flags) and FLAGS (command-specific flags), e.g.:
#
# $ make test GFLAGS='--packages cli'
%:
go run internal/build/build.go $(GFLAGS) $* $(FLAGS)

.PHONY: tag-test
tag-test:
go run internal/build/build.go -tags urfave_cli_no_docs test

.PHONY: tag-check-binary-size
tag-check-binary-size:
go run internal/build/build.go -tags urfave_cli_no_docs check-binary-size

.PHONY: gfmrun
gfmrun:
go run internal/build/build.go gfmrun docs/v2/manual.md

.PHONY: toc
toc:
go run internal/build/build.go toc docs/v2/manual.md
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ import (
...
```

### Build tags

You can use the following build tags:

#### `urfave_cli_no_docs`

When set, this removes `ToMarkdown` and `ToMan` methods, so your application
won't be able to call those. This reduces the resulting binary size by about
300-400 KB (measured using Go 1.18.1 on Linux/amd64), due to less dependencies.

### GOPATH

Make sure your `PATH` includes the `$GOPATH/bin` directory so your commands can
Expand All @@ -68,3 +78,7 @@ export PATH=$PATH:$GOPATH/bin
cli is tested against multiple versions of Go on Linux, and against the latest
released version of Go on OS X and Windows. This project uses Github Actions for
builds. To see our currently supported go versions and platforms, look at the [./.github/workflows/cli.yml](https://github.com/urfave/cli/blob/main/.github/workflows/cli.yml).

## License

See [`LICENSE`](./LICENSE)
Loading

0 comments on commit 31d6090

Please sign in to comment.