Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenning committed Nov 28, 2023
2 parents 59a07b0 + f90b4e1 commit ba6be50
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 33 deletions.
35 changes: 8 additions & 27 deletions dev_tools/deploy_docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,12 @@ build:
# Very Important... do not skip the backup step here...
mkdir -p $(GO_BIN_DIR)
make backup
-rm go.mod
go mod init deploy_docs
go mod tidy
-make fmt
make dep
make lint
go build $(GO_SOURCE_FILE)
strip deploy_docs
-make lint
#cd src && go vet .
############################################################################
#
# Replace this line with PLATFORM detection...
Expand Down Expand Up @@ -66,35 +62,20 @@ fmt:
go fmt $(GO_SOURCE_FILE)
.PHONY: fmt

install_linters:
@echo "$(COL_GREEN)>> installing linting tools$(COL_END)"
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
go install github.com/kisielk/errlint@latest
go install github.com/go-critic/go-critic/cmd/gocritic@latest
go install honnef.co/go/tools/cmd/staticlint@latest
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/mgechev/revive
.PHONY: install_linters

lint:
@echo "$(COL_GREEN)>> checking / linting the project$(COL_END)"
@echo "$(COL_CYAN)>> running go vet$(COL_END)"
go vet ./...
@echo "$(COL_CYAN)>> running shadow$(COL_END)"
shadow $(GO_SOURCE_FILE)
@echo "$(COL_CYAN)>> fixing suboptimal / unreferenced imports$(COL_END)"
goimports $(GO_SOURCE_FILE) > $(GO_SOURCE_FILE).imports
mv $(GO_SOURCE_FILE).imports $(GO_SOURCE_FILE)
@echo "$(COL_CYAN)>> running gocritic$(COL_END)"
gocritic check -enableAll $(GO_SOURCE_FILE)
@echo "$(COL_CYAN)>> running errcheck$(COL_END)"
errcheck -verbose $(GO_SOURCE_FILE)
revive -config revive_lint.toml .
.PHONY: lint

dep:
@echo "$(COL_GREEN)>> getting deploy_docs dependencies$(COL_END)"
go get github.com/melbahja/goph@latest
go get github.com/gleich/logoru@latest
@echo "$(COL_CYAN)>> delete old go files$(COL_END)"
-rm go.mod
-rm go.sum
@echo "$(COL_CYAN)>> create a new go.mod$(COL_END)"
go mod init github.com/mpenning/ciscoconfparse/dev_tools/deploy_docs
go mod tidy
go mod download
.PHONY: dep

backup:
Expand Down
5 changes: 3 additions & 2 deletions dev_tools/deploy_docs/deploy_docs.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// deploy_docs tool for deploying ciscoconfparse docs to pennington.net
package main

import (
Expand All @@ -13,13 +14,13 @@ import (

// Declare all variables here...
var (
dochost string = ""
dochost string
)

func main() {

// define CLI flags here... '--dochost' is saved as string variable -> dochost
flag.StringVar(&dochost, "dochost", "127.0.0.1", "host to upload docs to.")
flag.StringVar(&dochost, "dochost", "chestnut.he.net", "host to upload docs to.")
flag.Parse()

fmt.Printf("A script to upload CiscoConfParse docs to %s.\n", dochost)
Expand Down
4 changes: 2 additions & 2 deletions dev_tools/deploy_docs/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module deploy_docs
module github.com/mpenning/ciscoconfparse/dev_tools/deploy_docs

go 1.20
go 1.21.4

require (
github.com/gleich/logoru v0.0.0-20230101033757-d86cd895c7a1
Expand Down
4 changes: 2 additions & 2 deletions sphinx-doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Alternatively you can install with pip_: ::
If you have a specific version of ciscoconfparse in mind, you can specify that
at the command-line ::

pip install ciscoconfparse==1.9.37
pip install ciscoconfparse==1.9.40


Install with setuptools
Expand All @@ -113,7 +113,7 @@ If you don't have pip_, you can use setuptools_... ::
If you have a specific version of ciscoconfparse in mind, you can specify that
at the command-line ::

easy_install -U ciscoconfparse==1.9.37
easy_install -U ciscoconfparse==1.9.40

Install from the source
~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit ba6be50

Please sign in to comment.