Skip to content

Commit

Permalink
perf: init
Browse files Browse the repository at this point in the history
  • Loading branch information
ke zheng authored and ke zheng committed Sep 18, 2024
0 parents commit ce4a432
Show file tree
Hide file tree
Showing 425 changed files with 87,626 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cover.out
*~
*.test
release
experimental
coverage.txt
*.tar.bz2
parts/
prime/
stage/
mc
.run*
.idea/
mc.RELEASE*
mc.gz
.DS_Store
.vscode/
37 changes: 37 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
linters:
disable-all: true
enable:
- typecheck
- goimports
- misspell
- govet
- revive
- ineffassign
- gomodguard
- gofmt
- unused
- gofumpt

linters-settings:
golint:
min-confidence: 0

misspell:
locale: US

gofumpt:
lang-version: "1.17"

# Choose whether or not to use the extra rules that are disabled
# by default
extra-rules: false

issues:
exclude-use-default: false
exclude:
- instead of using struct literal
- should have a package comment
- error strings should not be capitalized or end with punctuation or a newline

service:
golangci-lint-version: 1.43.0 # use the fixed version to not introduce new linters unexpectedly
167 changes: 167 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
project_name: mc

release:
name_template: "Version {{.Version}}"
disable: true
github:
owner: minio
name: mc

env:
- CGO_ENABLED=0
- GO111MODULE=on

before:
hooks:
- make clean
- go generate ./...
- go mod tidy
- go mod download

builds:
-
goos:
- linux
- darwin
- windows
- freebsd

goarch:
- amd64
- arm64
- arm
- ppc64le
- s390x

goarm:
- 7

ignore:
- goos: darwin
goarch: arm64
- goos: darwin
goarch: arm
- goos: darwin
goarch: ppc64le
- goos: darwin
goarch: s390x
- goos: windows
goarch: arm64
- goos: windows
goarch: arm
- goos: windows
goarch: ppc64le
- goos: windows
goarch: s390x
- goos: freebsd
goarch: arm
- goos: freebsd
goarch: arm64
- goos: freebsd
goarch: ppc64le
- goos: freebsd
goarch: s390x

flags:
- -tags=kqueue
- -trimpath

ldflags:
- "-s -w -X github.com/minio/mc/cmd.Version={{.Version}} -X github.com/minio/mc/cmd.ReleaseTag={{.Tag}} -X github.com/minio/mc/cmd.CommitID={{.FullCommit}} -X github.com/minio/mc/cmd.ShortCommitID={{.ShortCommit}}"

archives:
-
format: binary
name_template: "{{ .Binary }}-release/{{ .Os }}-{{ .Arch }}/{{ .Binary }}.{{ .Version }}"

nfpms:
-
id: minio
package_name: mc
vendor: MinIO, Inc.
homepage: https://min.io/
maintainer: dev@min.io
description: MinIO Client (mc) provides a modern alternative to UNIX commands like ls, cat, cp, mirror, diff, find etc. It supports filesystems and Amazon S3 compatible cloud storage service (AWS Signature v2 and v4).
license: Apache 2.0
bindir: /usr/bin
formats:
- deb
- rpm
overrides:
deb:
file_name_template: "{{ .Binary }}-release/debs/{{ .ProjectName }}-{{ .Version }}_{{ .Arch }}"
replacements:
arm: armv7
files:
"NOTICE": "/usr/share/mc/NOTICE"
"CREDITS": "/usr/share/mc/CREDITS"
"LICENSE": "/usr/share/mc/LICENSE"
"README.md": "/usr/share/mc/README.md"
rpm:
file_name_template: "{{ .Binary }}-release/rpms/{{ .ProjectName }}-{{ .Version }}.{{ .Arch }}"
replacements:
amd64: x86_64
arm64: aarch64
arm: armv7
files:
"NOTICE": "/usr/share/mc/NOTICE"
"CREDITS": "/usr/share/mc/CREDITS"
"LICENSE": "/usr/share/mc/LICENSE"
"README.md": "/usr/share/mc/README.md"

checksum:
algorithm: sha256

signs:
-
signature: "${artifact}.asc"
cmd: "sh"
args:
- '-c'
- 'gpg --quiet --detach-sign -a ${artifact}'
artifacts: all

changelog:
sort: asc
filters:
exclude:
- '^Update yaml files'

dockers:
-
goos: linux
goarch: amd64
dockerfile: Dockerfile.release
image_templates:
- minio/mc:{{ .Tag }}
- minio/mc:latest

-
goos: linux
goarch: ppc64le
dockerfile: Dockerfile.ppc64le.release
image_templates:
- minio/mc:{{ .Tag }}-ppc64le

-
goos: linux
goarch: s390x
dockerfile: Dockerfile.s390x.release
image_templates:
- minio/mc:{{ .Tag }}-s390x

-
goos: linux
goarch: arm64
goarm: ''
dockerfile: Dockerfile.arm64.release
image_templates:
- minio/mc:{{ .Tag }}-arm64

-
goos: linux
goarch: arm
goarm: '7'
dockerfile: Dockerfile.arm.release
image_templates:
- minio/mc:{{ .Tag }}-arm
15 changes: 15 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generate CONTRIBUTORS.md: contributors.sh

# Tip for finding duplicates (besides scanning the output of CONTRIBUTORS.md for name
# duplicates that aren't also email duplicates): scan the output of:
# git log --format='%aE - %aN' | sort -uf
#
# For explanation on this file format: man git-shortlog

Anand Babu (AB) Periasamy <ab@min.io> Anand Babu (AB) Periasamy <abperiasamy@users.noreply.github.com>
Anand Babu (AB) Periasamy <ab@min.io> <ab@unlocksmith.org>
Anis Elleuch <vadmeste@gmail.com>
Frederick F. Kautz IV <fkautz@min.io> <fkautz@alumni.cmu.edu>
Harshavardhana <harsha@min.io> <harsha@harshavardhana.net>
Krishna Srinivas <krishna@min.io> <krishna.srinivas@gmail.com>
Bosky <bosky@helpshift.com>
11 changes: 11 additions & 0 deletions CONFLICT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## mc (MinIO Client) v/s Midnight Commander (mc)

There has been some amount of [requests](https://github.com/minio/mc/issues?q=is%3Aissue+midnight+commander+is%3Aclosed) on renaming this project to avoid the conflict with Midnight Commander for Unix distributions. We struggled with this, it is harder to find a name sweeter and shorter than `mc` for MinIO Client.

Besides `mc` is a single static binary and can reside inside your application and is fully self contained. Midnight Commander (mc) is a free software clone of Norton Commander (nc). MinIO and Midnight shares no code or ideas. Only their abbreviation matches.

Package managers are free to choose a different name if they like. One such solution [pointed out](https://github.com/minio/mc/issues/873#issuecomment-267583013) by one of our community members.

```
mv ./mc ./mcli
```
36 changes: 36 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
### Setup your mc Github Repository
Fork [mc upstream](https://github.com/minio/mc/fork) source repository to your own personal repository.
```
$ mkdir -p $GOPATH/src/github.com/minio
$ cd $GOPATH/src/github.com/minio
$ git clone https://github.com/$USER_ID/mc
$ cd mc
$ make
$ ./mc --help
```

### Developer Guidelines

``mc`` welcomes your contribution. To make the process as seamless as possible, we ask for the following:

* Go ahead and fork the project and make your changes. We encourage pull requests to discuss code changes.
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request

* If you have additional dependencies for ``mc``, ``mc`` manages its dependencies using `go mod`
- Run `go get foo/bar`
- Edit your code to import foo/bar
- Run `GO111MODULE=on go mod tidy` from top-level folder

* When you're ready to create a pull request, be sure to:
- Have test cases for the new code. If you have questions about how to do it, please ask in your pull request.
- Run `go fmt`
- Squash your commits into a single commit. `git rebase -i`. It's okay to force update your pull request.
- Make sure `make install` completes.

* Read [Effective Go](https://github.com/golang/go/wiki/CodeReviewComments) article from Golang project
- `mc` project is conformant with Golang style
- if you happen to observe offending code, please feel free to send a pull request
Loading

0 comments on commit ce4a432

Please sign in to comment.