Compare commits

..

8 commits

Author SHA1 Message Date
c5a5c3dfc2 [#10] Refine CODEOWNERS settings
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-12-10 14:21:43 +03:00
ac8eb3da71 [#10] Stop using obsolete .github directory
This commit is a part of multi-repo cleanup effort:
TrueCloudLab/frostfs-infra#136

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-11-06 15:39:01 +03:00
bd2fc65b5c [#9] Update obsolete URLs
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-09-11 14:10:28 +03:00
124ec832b1 [#7] .github: Remove directory
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-03-09 23:00:06 +03:00
5869aeada5 [#7] pre-commit: Add gitlint hook
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-03-09 23:00:06 +03:00
feab143fe5 [#7] pre-commit: Add golangci-lint hook
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-03-09 23:00:06 +03:00
d6b4e69399 [#7] pre-commit: Add initial configuration
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-03-09 23:00:06 +03:00
63e884006d Rename package name
Due to source code relocation from GitHub.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2023-03-07 13:47:29 +03:00
15 changed files with 59 additions and 111 deletions

1
.github/CODEOWNERS vendored
View file

@ -1 +0,0 @@
* @TrueCloudLab/storage-core @TrueCloudLab/storage-services @TrueCloudLab/committers

View file

@ -1,95 +0,0 @@
name: Tests
on:
pull_request:
branches:
- master
types: [ opened, synchronize ]
workflow_dispatch:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
test_cover:
name: Coverage
runs-on: ubuntu-20.04
env:
CGO_ENABLED: 0
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Restore Go modules from cache
uses: actions/cache@v2
with:
path: /home/runner/go/pkg/mod
key: deps-${{ hashFiles('go.sum') }}
- name: Update Go modules
run: go mod download -json
- name: Write coverage profile
run: go test -v ./... -coverprofile=./coverage.txt -covermode=atomic -coverpkg=./pkg...,./cli/...
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false
path_to_write_report: ./coverage.txt
verbose: true
tests:
name: Run tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04, windows-2022 ]
go_versions: [ '1.16', '1.17', '1.18' ]
exclude:
- os: windows-2022
go_versions: '1.16'
- os: windows-2022
go_versions: '1.17'
- os: ubuntu-20.04
go_versions: '1.18'
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '${{ matrix.go_versions }}'
- name: Restore Go modules from cache
uses: actions/cache@v2
with:
path: /home/runner/go/pkg/mod
key: deps-${{ hashFiles('go.sum') }}
- name: Update Go modules
run: go mod download -json
- name: Run tests
run: go test -v ./...
- name: Run generic tests
run: go test -v -count=1 ./... --tags=generic

10
.gitlint Normal file
View file

@ -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

30
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,30 @@
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$"
- repo: https://github.com/golangci/golangci-lint
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
CODEOWNERS Normal file
View file

@ -0,0 +1,2 @@
.* @TrueCloudLab/storage-core-committers @TrueCloudLab/storage-core-developers @TrueCloudLab/storage-services-committers @TrueCloudLab/storage-services-developers
.forgejo/.* @potyarkin

View file

@ -3,8 +3,8 @@
First, thank you for contributing! We love and encourage pull requests from First, thank you for contributing! We love and encourage pull requests from
everyone. Please follow the guidelines: everyone. Please follow the guidelines:
- Check the open [issues](https://github.com/TrueCloudLab/tzhash/issues) and - Check the open [issues](https://git.frostfs.info/TrueCloudLab/tzhash/issues) and
[pull requests](https://github.com/TrueCloudLab/tzhash/pulls) for existing [pull requests](https://git.frostfs.info/TrueCloudLab/tzhash/pulls) for existing
discussions. discussions.
- Open an issue first, to discuss a new feature or enhancement. - Open an issue first, to discuss a new feature or enhancement.
@ -27,19 +27,20 @@ Start by forking the `tzhash` repository, make changes in a branch and then
send a pull request. We encourage pull requests to discuss code changes. Here send a pull request. We encourage pull requests to discuss code changes. Here
are the steps in details: are the steps in details:
### Set up your GitHub Repository ### Set up your repository
Fork [TZHash upstream](https://github.com/TrueCloudLab/tzhash/fork) source
Fork [TZHash upstream](https://git.frostfs.info/TrueCloudLab/tzhash/fork) source
repository to your own personal repository. Copy the URL of your fork (you will repository to your own personal repository. Copy the URL of your fork (you will
need it for the `git clone` command below). need it for the `git clone` command below).
```sh ```sh
$ git clone https://github.com/TrueCloudLab/tzhash $ git clone https://git.frostfs.info/TrueCloudLab/tzhash
``` ```
### Set up git remote as ``upstream`` ### Set up git remote as ``upstream``
```sh ```sh
$ cd tzhash $ cd tzhash
$ git remote add upstream https://github.com/TrueCloudLab/tzhash $ git remote add upstream https://git.frostfs.info/TrueCloudLab/tzhash
$ git fetch upstream $ git fetch upstream
$ git merge upstream/master $ git merge upstream/master
... ...
@ -88,7 +89,8 @@ $ git push origin feature/123-something_awesome
``` ```
### Create a Pull Request ### Create a Pull Request
Pull requests can be created via GitHub. Refer to [this
Pull requests can be created via git.frostfs.info. Refer to [this
document](https://help.github.com/articles/creating-a-pull-request/) for document](https://help.github.com/articles/creating-a-pull-request/) for
detailed steps on how to create a pull request. After a Pull Request gets peer detailed steps on how to create a pull request. After a Pull Request gets peer
reviewed and approved, it will be merged. reviewed and approved, it will be merged.

0
Makefile Normal file → Executable file
View file

View file

@ -7,7 +7,7 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/TrueCloudLab/tzhash/tz" "git.frostfs.info/TrueCloudLab/tzhash/tz"
) )
var ( var (

View file

@ -10,7 +10,7 @@ import (
"runtime" "runtime"
"runtime/pprof" "runtime/pprof"
"github.com/TrueCloudLab/tzhash/tz" "git.frostfs.info/TrueCloudLab/tzhash/tz"
"golang.org/x/sys/cpu" "golang.org/x/sys/cpu"
) )

View file

@ -11,7 +11,7 @@ package gf127
import "golang.org/x/sys/cpu" import "golang.org/x/sys/cpu"
// x127x63 represents x^127 + x^63 // x127x63 represents x^127 + x^63
var x127x63 = GF127{msb64, msb64} //nolint:deadcode,varcheck var x127x63 = GF127{msb64, msb64} //nolint:unused
// Add sets c to a+b. // Add sets c to a+b.
func Add(a, b, c *GF127) { func Add(a, b, c *GF127) {

2
go.mod
View file

@ -1,4 +1,4 @@
module github.com/TrueCloudLab/tzhash module git.frostfs.info/TrueCloudLab/tzhash
go 1.16 go 1.16

View file

@ -1,7 +1,7 @@
package tz package tz
import ( import (
"github.com/TrueCloudLab/tzhash/gf127" "git.frostfs.info/TrueCloudLab/tzhash/gf127"
) )
const ( const (

View file

@ -4,7 +4,7 @@
package tz package tz
import ( import (
"github.com/TrueCloudLab/tzhash/gf127" "git.frostfs.info/TrueCloudLab/tzhash/gf127"
"golang.org/x/sys/cpu" "golang.org/x/sys/cpu"
) )

View file

@ -3,7 +3,7 @@ package tz
import ( import (
"errors" "errors"
"github.com/TrueCloudLab/tzhash/gf127" "git.frostfs.info/TrueCloudLab/tzhash/gf127"
) )
type ( type (

View file

@ -5,7 +5,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/TrueCloudLab/tzhash/gf127" "git.frostfs.info/TrueCloudLab/tzhash/gf127"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )