From b69b61399ebb0bf98e9f98817abd48895bce68f5 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 3 Mar 2023 12:51:08 +0300 Subject: [PATCH 1/4] [#7] pre-commit: Add initial configuration Signed-off-by: Evgenii Stratonikov --- .golangci.yml | 4 ++-- .pre-commit-config.yaml | 19 +++++++++++++++++++ CHANGELOG.md | 34 +++++++++++++++++----------------- Makefile | 0 4 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 .pre-commit-config.yaml mode change 100644 => 100755 Makefile diff --git a/.golangci.yml b/.golangci.yml index 8f35944..5abd044 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,7 +11,7 @@ run: skip-files: - (^|.*/)grpc/(.*) - + # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" @@ -64,4 +64,4 @@ issues: - linters: # ignore SA6002 since we use pool of []byte, however we can switch to *bytes.Buffer - staticcheck - text: "SA6002:" \ No newline at end of file + text: "SA6002:" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9c6f604 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,19 @@ +ci: + autofix_prs: false + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + - id: check-merge-conflict + - id: check-json + - id: check-xml + - id: check-yaml + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + - id: end-of-file-fixer + exclude: ".key$" diff --git a/CHANGELOG.md b/CHANGELOG.md index c49300a..3b31e83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ - Mark all expiration methods as deprecated (#417) ### Updated -- Minimal go version to 1.17 (#412) +- Minimal go version to 1.17 (#412) - `neofs-crypto` to `v0.4.0` (#412) - `google.golang.org/grpc` to `v1.48.0` (#415) - `google.golang.org/protobuf` to `v1.28.0` (#415) @@ -60,7 +60,7 @@ NeoFS API v2.13 support ### Fixed - Incompatible changes in signature scheme (#380) - + ### Added - Public URI-parsing function `client.ParseURI()` (#383) @@ -92,9 +92,9 @@ NeoFS API v2.12 support ## [2.11.0] - 2021-12-02 - Sinjido (신지도, 薪智島) -NeoFS API v2.11 support. High level packages are moved to -[neofs-sdk-go](https://github.com/nspcc-dev/neofs-sdk-go) repository. -Repository restructured as Go module version 2 and synced with +NeoFS API v2.11 support. High level packages are moved to +[neofs-sdk-go](https://github.com/nspcc-dev/neofs-sdk-go) repository. +Repository restructured as Go module version 2 and synced with [neofs-api](https://github.com/nspcc-dev/neofs-api) release version. ### Fixed @@ -109,7 +109,7 @@ Repository restructured as Go module version 2 and synced with - neofs-api-go is now Go module version 2 (#201) ### Removed -- All packages from `pkg` moved to +- All packages from `pkg` moved to [neofs-sdk-go](https://github.com/nspcc-dev/neofs-sdk-go) (#201) ## [1.30.0] - 2021-10-19 - Udo (우도, 牛島) @@ -126,7 +126,7 @@ NeoFS API v2.10 support. - pkg/client callback to parse internal response information (#337) - Service filter type in extended ACL from API v2.10 (#338) - Enhanced network info structures from API v2.10 (#339) -- Well-known public-append basic ACL constant (#341) +- Well-known public-append basic ACL constant (#341) - Native contract names support (#351) ### Changed @@ -258,7 +258,7 @@ Raw client and support of NeoFS API v2.5.0 "Jebudo" release. ### Added - Raw client for peer to peer communication. -- `client.WithKey` option to sign messages with different keys within single +- `client.WithKey` option to sign messages with different keys within single client. - `Content-Type` well-known object attribute constant. @@ -271,7 +271,7 @@ Raw client and support of NeoFS API v2.5.0 "Jebudo" release. Support changes from NeoFS API v2.4.0 "Ganghwado" release. -### Added +### Added - `netmap.NetworkInfo` definitions in `v2` and `pkg/netmap`. - `netmap.NetworkInfo` RPC support in `pkg/client`. @@ -322,7 +322,7 @@ Support changes from NeoFS API v2.2.1 release. ### Fixed -- Remarks of the updated linter. +- Remarks of the updated linter. ## [1.22.0] - 2020-12-30 - Yeouido (여의도, 汝矣島) @@ -335,7 +335,7 @@ Support changes from NeoFS API v2.2.0 "Yeouido" release. - Support of `StorageGroup` message. - Support of `DataAuditResult` message. - Stringer and string parser for `Checksum` type of client library. -- Stringer and string parser for `Type` message. +- Stringer and string parser for `Type` message. - Stringer and string parser for `Type` type of client library. - `AddTypeFilter` method on `SearchFilters` type of client library that adds filter by object type. @@ -350,7 +350,7 @@ Support changes from NeoFS API v2.2.0 "Yeouido" release. - `Container.SetNonceUUID` setter of container nonce in UUID format. - `NewVerifiedContainerFromV2` container constructor that preliminary checks if container message argument meets NeoFS API V2 specification. - + ### Changed - `Container.Nonce`/`Container.SetNonce` marked as deprecated. @@ -368,7 +368,7 @@ Support neofs-api v2.1.1. ### Added -- `client.GetVerifiedContainerStructure` function to check +- `client.GetVerifiedContainerStructure` function to check that the container structure matches the requested identifier. ## [1.21.0] - 2020-12-11 - Modo (모도, 茅島) @@ -391,7 +391,7 @@ Support neofs-api v2.1.1. ### Renamed -- `AddLeafFilter` to `AddPhyFilter` +- `AddLeafFilter` to `AddPhyFilter` ### Fixed @@ -425,9 +425,9 @@ Support neofs-api v2.1.1. ## [1.20.0] - 2020-11-16 - Jindo (진도, 珍島) -Major API refactoring and simplification. From now on this library will have -backward compatibility and support of major versions of NeoFS-API by having -**version specific** files in `vN` dirs and **version independent** SDK +Major API refactoring and simplification. From now on this library will have +backward compatibility and support of major versions of NeoFS-API by having +**version specific** files in `vN` dirs and **version independent** SDK structures and client in `pkg`. This version supports NeoFS-API v2.0.X diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 -- 2.45.2 From 8f9c4a22706a2676fc284aa1893d52dc649d95d4 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 3 Mar 2023 12:55:17 +0300 Subject: [PATCH 2/4] [#7] pre-commit: Add golangci-lint hook Signed-off-by: Evgenii Stratonikov --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c6f604..46c9c89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,3 +17,8 @@ repos: args: [--markdown-linebreak-ext=md] - id: end-of-file-fixer exclude: ".key$" + + - repo: https://github.com/golangci/golangci-lint + rev: v1.51.2 + hooks: + - id: golangci-lint -- 2.45.2 From 0f8183e41fddce1f0029b8137c7ef57b04c3d1b3 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 3 Mar 2023 12:55:38 +0300 Subject: [PATCH 3/4] [#7] pre-commit: Add gitlint hook Signed-off-by: Evgenii Stratonikov --- .gitlint | 10 ++++++++++ .pre-commit-config.yaml | 6 ++++++ 2 files changed, 16 insertions(+) create mode 100644 .gitlint diff --git a/.gitlint b/.gitlint new file mode 100644 index 0000000..9ce883f --- /dev/null +++ b/.gitlint @@ -0,0 +1,10 @@ +[general] +fail-without-commits=true +contrib=CC1 + +[title-match-regex] +regex=^\[\#[0-9]+\]\s + +[ignore-by-title] +regex=^Release(.*) +ignore=title-match-regex diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46c9c89..3050af4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,3 +22,9 @@ repos: rev: v1.51.2 hooks: - id: golangci-lint + + - repo: https://github.com/jorisroovers/gitlint + rev: v0.18.0 + hooks: + - id: gitlint + stages: [commit-msg] -- 2.45.2 From 98b07ceab18d6632cab3322bb35f16a995d711f8 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 7 Mar 2023 09:56:34 +0300 Subject: [PATCH 4/4] [#7] .github: Remove directory Signed-off-by: Evgenii Stratonikov --- .github/logo.svg | 70 --------------------------------------- .github/workflows/dco.yml | 21 ------------ .github/workflows/go.yml | 64 ----------------------------------- 3 files changed, 155 deletions(-) delete mode 100644 .github/logo.svg delete mode 100644 .github/workflows/dco.yml delete mode 100644 .github/workflows/go.yml diff --git a/.github/logo.svg b/.github/logo.svg deleted file mode 100644 index 148c359..0000000 --- a/.github/logo.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml deleted file mode 100644 index 40ed8fc..0000000 --- a/.github/workflows/dco.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: DCO check - -on: - pull_request: - branches: - - master - -jobs: - commits_check_job: - runs-on: ubuntu-latest - name: Commits Check - steps: - - name: Get PR Commits - id: 'get-pr-commits' - uses: tim-actions/get-pr-commits@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: DCO Check - uses: tim-actions/dco@master - with: - commits: ${{ steps.get-pr-commits.outputs.commits }} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 48e770c..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: neofs-api-go tests - -on: - push: - branches: - - master - paths-ignore: - - '*.md' - pull_request: - branches: - - master - paths-ignore: - - '*.md' - -jobs: - test: - runs-on: ubuntu-20.04 - strategy: - matrix: - go: [ '1.17.x', '1.18.x', '1.19.x' ] - steps: - - name: Setup go - uses: actions/setup-go@v3 - with: - go-version: ${{ matrix.go }} - - - name: Check out code - uses: actions/checkout@v3 - - - name: Cache go mod - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go-${{ matrix.go }}- - - - name: Get dependencies - run: make dep - - - name: Run go test - run: go test -coverprofile=coverage.txt -covermode=atomic ./... - - - name: Codecov - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: bash <(curl -s https://codecov.io/bash) - - lint: - runs-on: ubuntu-20.04 - steps: - - name: Setup go - uses: actions/setup-go@v3 - with: - go-version: 1.19 - - - name: Check out code - uses: actions/checkout@v3 - - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.48.0 - only-new-issues: true -- 2.45.2