Skip to content

Commit

Permalink
docs: Polishing up the provider function documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzyx committed Mar 11, 2024
1 parent 2a3d46e commit 5be683c
Show file tree
Hide file tree
Showing 20 changed files with 269 additions and 210 deletions.
33 changes: 19 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ output:

# Add a prefix to the output file references.
# Default is no prefix.
path-prefix: ''
path-prefix: ""

# Sort results by: filepath, line and column.
sort-results: true
Expand Down Expand Up @@ -524,7 +524,7 @@ linters-settings:
- NOTE
- OPTIMIZE
- TODO
- '@TODO'
- "@TODO"

gofmt:
# Simplify code: gofmt with `-s` option.
Expand Down Expand Up @@ -573,8 +573,8 @@ linters-settings:
# Values always ignored: "1", "1.0", "0" and "0.0"
# Default: []
ignored-numbers:
- '0666'
- '0755'
- "0666"
- "0755"

# List of file patterns to exclude from analysis.
# Values always ignored: `.+_test.go`
Expand All @@ -597,7 +597,7 @@ linters-settings:
gosimple:
# Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
# Default: ["*"]
checks: ['*']
checks: ["*"]

gosec:
# To select a subset of rules to run.
Expand Down Expand Up @@ -659,16 +659,16 @@ linters-settings:

# Maximum allowed entropy of the string.
# Default: "80.0"
entropy_threshold: '80.0'
entropy_threshold: "80.0"

# Maximum allowed value of entropy/string length.
# Is taken into account if entropy >= entropy_threshold/2.
# Default: "3.0"
per_char_threshold: '3.0'
per_char_threshold: "3.0"

# Calculate entropy for first N chars of the string.
# Default: "16"
truncate: '16'
truncate: "16"

# Additional functions to ignore while checking unhandled errors.
# Following functions always ignored:
Expand Down Expand Up @@ -707,15 +707,15 @@ linters-settings:

# Maximum allowed permissions mode for os.Mkdir and os.MkdirAll
# Default: "0750"
G301: '0750'
G301: "0750"

# Maximum allowed permissions mode for os.OpenFile and os.Chmod
# Default: "0600"
G302: '0600'
G302: "0600"

# Maximum allowed permissions mode for os.WriteFile and ioutil.WriteFile
# Default: "0666"
G306: '0666'
G306: "0666"

# gosmopolitan:

Expand Down Expand Up @@ -940,12 +940,12 @@ linters-settings:
# https://staticcheck.io/docs/options#checks
# https://staticcheck.io/docs/checks/
# Default: ["*"]
checks: ['*']
checks: ["*"]

stylecheck:
# STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
# Default: ["*"]
checks: ['*']
checks: ["*"]

# https://staticcheck.io/docs/configuration/options/#dot_import_whitelist
# Default: ["github.com/mmcloughlin/avo/build", "github.com/mmcloughlin/avo/operand", "github.com/mmcloughlin/avo/reg"]
Expand Down Expand Up @@ -1282,7 +1282,7 @@ issues:
- gomnd
source: lint:allow_raw_number

- text: 'commentedOutCode: may want to remove commented-out code'
- text: "commentedOutCode: may want to remove commented-out code"
linters:
- gocritic
source: lint:allow_commented
Expand Down Expand Up @@ -1374,6 +1374,11 @@ issues:
- gocognit
source: lint:allow_complexity

- text: (make it a constant)
linters:
- goconst
source: lint:no_const

# If set to true exclude and exclude-rules regular expressions become case-sensitive.
# Default: false
exclude-case-sensitive: false
Expand Down
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ clean-tf:
find . -type d -name ".terraform" | xargs -I% rm -Rfv "%"
find . -type f -name ".terraform.lock.hcl" | xargs -I% rm -fv "%"

.PHONY: clean-ds
## clean-ds: [clean] Clean .DS_Store files.
clean-ds:
@ $(ECHO) " "
@ $(ECHO) "\033[1;33m=====> Cleaning .DS_Store files....\033[0m"
find . -type f -name ".DS_Store" | xargs -I% rm -fv "%"

.PHONY: clean
## clean: [clean]* Runs ALL cleaning tasks (except the Go cache).
clean: clean-bench clean-tf clean-tests
Expand All @@ -181,11 +188,16 @@ docs: docs-provider docs-cli

.PHONY: docs-provider
## docs-provider: [docs] Generate Terraform Registry documentation.
docs-provider:
docs-provider: clean-ds
@ $(ECHO) " "
@ $(ECHO) "\033[1;33m=====> Generating Terraform provider documentation...\033[0m"
$(GO) generate -v ./...

@ $(ECHO) " "
@ $(ECHO) "\033[1;33m=====> Remove tfplugindocs comments...\033[0m"
find docs/ -type f -name "*.md" | xargs -I% sed -i 's|<!-- arguments generated by tfplugindocs -->||g' "%"
find docs/ -type f -name "*.md" | xargs -I% sed -i 's|<!-- variadic argument generated by tfplugindocs -->||g' "%"

@ $(ECHO) " "
# Will probably fail.
- pre-commit run --all-files markdownlint
Expand Down
Binary file modified acc-coverage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5be683c

Please sign in to comment.