Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
burrow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hang Yu
burrow
Commits
54614811
Unverified
Commit
54614811
authored
8 years ago
by
Benjamin Bollen
Browse files
Options
Downloads
Patches
Plain Diff
make: introduce first make commands for formatting and lint
parent
d53f406e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+45
-0
45 additions, 0 deletions
Makefile
client/client.go
+1
-1
1 addition, 1 deletion
client/client.go
with
46 additions
and
1 deletion
Makefile
0 → 100644
+
45
−
0
View file @
54614811
# TARGET = eris-db
# IMAGE = quay.io/eris/db
SHELL
:=
/bin/bash
GOFILES_NOVENDOR
:=
$(
shell find
.
-type
f
-name
'*.go'
-not
-path
"./vendor/*"
)
PACKAGES_NOVENDOR
:=
$(
shell go list github.com/eris-ltd/eris-db/... |
grep
-v
/vendor/
)
VERSION_MIN
:=
$(
shell
cat
./version/version.go |
tail
-n
1 |
cut
-d
\
-f
4 |
tr
-d
'"'
)
VERSION_MAJ
:=
$(
shell
echo
${
VERSION_MIN
}
|
cut
-d
.
-f
1-2
)
.PHONY
:
greet
greet
:
@
echo
"Hi! I'm the marmot that will help you with eris-db v
${
VERSION_MIN
}
"
### Formatting, linting and vetting
# check the code for style standards; currently enforces go formatting.
# display output first, then check for success
.PHONY
:
check
check
:
@
echo
"Checking code for formatting style compliance."
@
gofmt
-l
-d
${
GOFILES_NOVENDOR
}
@
gofmt
-l
${
GOFILES_NOVENDOR
}
|
read
&&
echo
&&
echo
"Your marmot has found a problem with the formatting style of the code."
1>&2
&&
exit
1
||
true
# fmt runs gofmt -w on the code, modifying any files that do not match
# the style guide.
.PHONY
:
fmt
fmt
:
@
echo
"Correcting any formatting style corrections."
@
gofmt
-l
-w
${
GOFILES_NOVENDOR
}
# lint installs golint and prints recommendations for coding style.
lint
:
@
echo
"Running lint checks."
go get
-u
github.com/golang/lint/golint
@
for
file
in
$(
GOFILES_NOVENDOR
);
do
\
echo
;
\
golint
--set_exit_status
$${
file
};
\
done
# vet runs extended compilation checks to find recommendations for
# suspicious code constructs.
.PHONY
:
vet
vet
:
@
echo
"Running go vet."
@
go vet
${
PACKAGES_NOVENDOR
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
client/client.go
+
1
−
1
View file @
54614811
...
@@ -80,7 +80,7 @@ func NewErisNodeClient(rpcString string) *ErisNodeClient {
...
@@ -80,7 +80,7 @@ func NewErisNodeClient(rpcString string) *ErisNodeClient {
// it needs to be initialised before go-rpc, hence it's placement here.
// it needs to be initialised before go-rpc, hence it's placement here.
func
init
()
{
func
init
()
{
h
:=
tendermint_log
.
LvlFilterHandler
(
tendermint_log
.
LvlWarn
,
tendermint_log
.
StdoutHandler
)
h
:=
tendermint_log
.
LvlFilterHandler
(
tendermint_log
.
LvlWarn
,
tendermint_log
.
StdoutHandler
)
tendermint_log
.
Root
()
.
SetHandler
(
h
)
tendermint_log
.
Root
()
.
SetHandler
(
h
)
}
}
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment