Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
49f79932
Commit
49f79932
authored
Dec 10, 2020
by
Jacob Vosmaer
Committed by
Nick Thomas
Dec 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makefile: remove find NO CHANGELOG
parent
d804172f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
17 deletions
+35
-17
Makefile
Makefile
+10
-8
_support/fmt.sh
_support/fmt.sh
+25
-0
_support/validate-formatting.sh
_support/validate-formatting.sh
+0
-9
No files found.
Makefile
View file @
49f79932
...
@@ -22,8 +22,6 @@ export PATH := $(GOBIN):$(PATH)
...
@@ -22,8 +22,6 @@ export PATH := $(GOBIN):$(PATH)
export
GOPROXY
?=
https://proxy.golang.org
export
GOPROXY
?=
https://proxy.golang.org
export
GO111MODULE
=
on
export
GO111MODULE
=
on
LOCAL_GO_FILES
=
$(
shell
find
.
-type
f
-name
'*.go'
|
grep
-v
-e
/_
-e
/testdata/
-e
'^\./\.'
)
define
message
define
message
@echo
"### $(1)"
@echo
"### $(1)"
endef
endef
...
@@ -40,19 +38,23 @@ $(TARGET_SETUP):
...
@@ -40,19 +38,23 @@ $(TARGET_SETUP):
mkdir
-p
"
$(TARGET_DIR)
"
mkdir
-p
"
$(TARGET_DIR)
"
touch
"
$(TARGET_SETUP)
"
touch
"
$(TARGET_SETUP)
"
gitlab-resize-image
:
$(TARGET_SETUP) $(shell find cmd/gitlab-resize-image/ -name '*.go')
.PHONY
:
gitlab-resize-image
gitlab-resize-image
:
$(TARGET_SETUP)
$(
call
message,Building
$@
)
$(
call
message,Building
$@
)
$(GOBUILD)
-tags
"
$(BUILD_TAGS)
"
-o
$(BUILD_DIR)
/
$@
$(PKG)
/cmd/
$@
$(GOBUILD)
-tags
"
$(BUILD_TAGS)
"
-o
$(BUILD_DIR)
/
$@
$(PKG)
/cmd/
$@
gitlab-zip-cat
:
$(TARGET_SETUP) $(shell find cmd/gitlab-zip-cat/ -name '*.go')
.PHONY
:
gitlab-zip-cat
gitlab-zip-cat
:
$(TARGET_SETUP)
$(
call
message,Building
$@
)
$(
call
message,Building
$@
)
$(GOBUILD)
-tags
"
$(BUILD_TAGS)
"
-o
$(BUILD_DIR)
/
$@
$(PKG)
/cmd/
$@
$(GOBUILD)
-tags
"
$(BUILD_TAGS)
"
-o
$(BUILD_DIR)
/
$@
$(PKG)
/cmd/
$@
gitlab-zip-metadata
:
$(TARGET_SETUP) $(shell find cmd/gitlab-zip-metadata/ -name '*.go')
.PHONY
:
gitlab-zip-metadata
gitlab-zip-metadata
:
$(TARGET_SETUP)
$(
call
message,Building
$@
)
$(
call
message,Building
$@
)
$(GOBUILD)
-tags
"
$(BUILD_TAGS)
"
-o
$(BUILD_DIR)
/
$@
$(PKG)
/cmd/
$@
$(GOBUILD)
-tags
"
$(BUILD_TAGS)
"
-o
$(BUILD_DIR)
/
$@
$(PKG)
/cmd/
$@
gitlab-workhorse
:
$(TARGET_SETUP) $(shell find . -name '*.go' | grep -v '^
\.
/_')
.PHONY
:
gitlab-workhorse
gitlab-workhorse
:
$(TARGET_SETUP)
$(
call
message,Building
$@
)
$(
call
message,Building
$@
)
$(GOBUILD)
-tags
"
$(BUILD_TAGS)
"
-o
$(BUILD_DIR)
/
$@
$(PKG)
$(GOBUILD)
-tags
"
$(BUILD_TAGS)
"
-o
$(BUILD_DIR)
/
$@
$(PKG)
...
@@ -142,7 +144,7 @@ detect-assert:
...
@@ -142,7 +144,7 @@ detect-assert:
.PHONY
:
check-formatting
.PHONY
:
check-formatting
check-formatting
:
$(TARGET_SETUP) install-goimports
check-formatting
:
$(TARGET_SETUP) install-goimports
$(
call
message,Verify:
$@
)
$(
call
message,Verify:
$@
)
@
_support/
validate-formatting.sh
$(LOCAL_GO_FILES)
@
_support/
fmt.sh check
# Megacheck will tailor some responses given a minimum Go version, so pass that through the CLI
# Megacheck will tailor some responses given a minimum Go version, so pass that through the CLI
# Additionally, megacheck will not return failure exit codes unless explicitly told to via the
# Additionally, megacheck will not return failure exit codes unless explicitly told to via the
...
@@ -158,7 +160,7 @@ staticcheck: $(TARGET_SETUP)
...
@@ -158,7 +160,7 @@ staticcheck: $(TARGET_SETUP)
.PHONY
:
fmt
.PHONY
:
fmt
fmt
:
$(TARGET_SETUP) install-goimports
fmt
:
$(TARGET_SETUP) install-goimports
$(
call
message,
$@
)
$(
call
message,
$@
)
@
goimports
-w
-local
$(PKG)
-l
$(LOCAL_GO_FILES)
@
_support/fmt.sh
.PHONY
:
goimports
.PHONY
:
goimports
install-goimports
:
$(TARGET_SETUP)
install-goimports
:
$(TARGET_SETUP)
...
...
_support/fmt.sh
0 → 100755
View file @
49f79932
#!/bin/sh
FLAG
=
-w
if
[
"x
$1
"
=
xcheck
]
;
then
FLAG
=
-e
fi
IMPORT_RESULT
=
$(
goimports
$FLAG
-local
"gitlab.com/gitlab-org/gitlab-workhorse"
-l
$(
find
.
-type
f
-name
'*.go'
|
grep
-v
-e
/_
-e
/testdata/
-e
'^\./\.'
)
)
case
"x
$1
"
in
xcheck
)
if
[
-n
"
${
IMPORT_RESULT
}
"
]
;
then
echo
>
&2
"Formatting or imports need fixing: 'make fmt'"
echo
"
${
IMPORT_RESULT
}
"
exit
1
fi
;;
x
)
echo
"
${
IMPORT_RESULT
}
"
;;
esac
_support/validate-formatting.sh
deleted
100755 → 0
View file @
d804172f
#!/bin/sh
IMPORT_RESULT
=
$(
goimports
-e
-local
"gitlab.com/gitlab-org/gitlab-workhorse"
-l
"
$@
"
)
if
[
-n
"
${
IMPORT_RESULT
}
"
]
;
then
echo
>
&2
"Formatting or imports need fixing: 'make fmt'"
echo
"
${
IMPORT_RESULT
}
"
exit
1
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment