[#23] pre-commit: Add initial configuration

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
pull/23/head
Evgenii Stratonikov 2023-03-03 12:29:33 +03:00
parent 94476f9055
commit b761fd8070
22 changed files with 43 additions and 24 deletions

2
.gitignore vendored
View File

@ -20,4 +20,4 @@ vendor/
# coverage
coverage.txt
coverage.html
coverage.html

View File

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

2
Makefile 100644 → 100755
View File

@ -37,4 +37,4 @@ help:
@echo ''
@echo ' Targets:'
@echo ''
@awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9_-]+ ?:/{ print " ", $$1, comment }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort -u
@awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9_-]+ ?:/{ print " ", $$1, comment }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort -u

View File

@ -54,7 +54,7 @@ err := c.Dial(prmDial)
if err != nil {
return
}
ctx, cancel := context.WithTimeout(context.Background(), 5 * time.Second)
defer cancel()
@ -98,7 +98,7 @@ Contains CRUSH-like implementation of container node selection algorithm. Releva
are described in this paper http://ceur-ws.org/Vol-2344/short10.pdf . Note that it can be
outdated in some details.
`netmap/json_tests` subfolder contains language-agnostic tests for selection algorithm.
`netmap/json_tests` subfolder contains language-agnostic tests for selection algorithm.
```go
import (
@ -110,7 +110,7 @@ func placementNodes(addr *object.Address, p *netmap.PlacementPolicy, frostfsNode
// Convert list of nodes in FrostFS API format to the intermediate representation.
nodes := netmap.NodesFromInfo(nodes)
// Create new netmap (errors are skipped for the sake of clarity).
// Create new netmap (errors are skipped for the sake of clarity).
nm, _ := NewNetmap(nodes)
// Calculate nodes of container.
@ -131,4 +131,4 @@ Contain simple API wrappers.
Wrapper over `zap.Logger` which is used across FrostFS codebase.
### util
Utilities for working with signature-related code.
Utilities for working with signature-related code.

View File

@ -15,4 +15,4 @@ Field|Description
`pivot`|Optional pivot to use in container node selection.
`result`|List of lists of node-indices corresponding to each replica in the placement policy.
`error`|Error that should be raised for this specific test. The actual strings are used in SDK, other implementation may simply check that error has occurred.
`placement`|Optional field containing another test for selecting placement nodes for an object. Can contain `pivot`, `result` and `error` fields with the same meaning as above. Note that if `pivot` is omitted, empty value should be used.
`placement`|Optional field containing another test for selecting placement nodes for an object. Can contain `pivot`, `result` and `error` fields with the same meaning as above. Note that if `pivot` is omitted, empty value should be used.

View File

@ -97,4 +97,4 @@
]
}
}
}
}

View File

@ -98,4 +98,4 @@
]
}
}
}
}

View File

@ -156,4 +156,4 @@
]
}
}
}
}

View File

@ -384,4 +384,4 @@
"error": "not enough nodes"
}
}
}
}

View File

@ -80,4 +80,4 @@
"error": "not enough nodes"
}
}
}
}

View File

@ -412,4 +412,4 @@
"error": "not enough nodes"
}
}
}
}

View File

@ -162,4 +162,4 @@
}
}
}
}
}

View File

@ -106,4 +106,4 @@
]
}
}
}
}

View File

@ -189,4 +189,4 @@
]
}
}
}
}

View File

@ -92,4 +92,4 @@
]
}
}
}
}

View File

@ -329,4 +329,4 @@
]
}
}
}
}

View File

@ -110,4 +110,4 @@
"error": "not enough nodes"
}
}
}
}

View File

@ -114,4 +114,4 @@
]
}
}
}
}

View File

@ -101,4 +101,4 @@
"error": "not enough nodes"
}
}
}
}

View File

@ -251,4 +251,4 @@
"error": "not enough nodes"
}
}
}
}

View File

@ -64,4 +64,4 @@ identWC
atn:
[4, 1, 21, 130, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 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, 110, 1, 0, 0, 0, 18, 115, 1, 0, 0, 0, 20, 117, 1, 0, 0, 0, 22, 119, 1, 0, 0, 0, 24, 123, 1, 0, 0, 0, 26, 127, 1, 0, 0, 0, 28, 30, 3, 2, 1, 0, 29, 28, 1, 0, 0, 0, 30, 31, 1, 0, 0, 0, 31, 29, 1, 0, 0, 0, 31, 32, 1, 0, 0, 0, 32, 34, 1, 0, 0, 0, 33, 35, 3, 4, 2, 0, 34, 33, 1, 0, 0, 0, 34, 35, 1, 0, 0, 0, 35, 39, 1, 0, 0, 0, 36, 38, 3, 6, 3, 0, 37, 36, 1, 0, 0, 0, 38, 41, 1, 0, 0, 0, 39, 37, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 45, 1, 0, 0, 0, 41, 39, 1, 0, 0, 0, 42, 44, 3, 12, 6, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 51, 5, 4, 0, 0, 51, 54, 5, 18, 0, 0, 52, 53, 5, 5, 0, 0, 53, 55, 3, 24, 12, 0, 54, 52, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 57, 5, 7, 0, 0, 57, 58, 5, 18, 0, 0, 58, 5, 1, 0, 0, 0, 59, 60, 5, 8, 0, 0, 60, 66, 5, 18, 0, 0, 61, 63, 5, 5, 0, 0, 62, 64, 3, 8, 4, 0, 63, 62, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 67, 3, 24, 12, 0, 66, 61, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 69, 5, 9, 0, 0, 69, 72, 3, 26, 13, 0, 70, 71, 5, 6, 0, 0, 71, 73, 3, 24, 12, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 7, 1, 0, 0, 0, 74, 75, 7, 0, 0, 0, 75, 9, 1, 0, 0, 0, 76, 77, 6, 5, -1, 0, 77, 78, 5, 14, 0, 0, 78, 79, 3, 10, 5, 0, 79, 80, 5, 15, 0, 0, 80, 83, 1, 0, 0, 0, 81, 83, 3, 14, 7, 0, 82, 76, 1, 0, 0, 0, 82, 81, 1, 0, 0, 0, 83, 92, 1, 0, 0, 0, 84, 85, 10, 4, 0, 0, 85, 86, 5, 1, 0, 0, 86, 91, 3, 10, 5, 5, 87, 88, 10, 3, 0, 0, 88, 89, 5, 2, 0, 0, 89, 91, 3, 10, 5, 4, 90, 84, 1, 0, 0, 0, 90, 87, 1, 0, 0, 0, 91, 94, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 11, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 95, 96, 5, 10, 0, 0, 96, 97, 3, 10, 5, 0, 97, 98, 5, 6, 0, 0, 98, 99, 3, 24, 12, 0, 99, 13, 1, 0, 0, 0, 100, 101, 5, 16, 0, 0, 101, 107, 3, 24, 12, 0, 102, 103, 3, 16, 8, 0, 103, 104, 5, 3, 0, 0, 104, 105, 3, 18, 9, 0, 105, 107, 1, 0, 0, 0, 106, 100, 1, 0, 0, 0, 106, 102, 1, 0, 0, 0, 107, 15, 1, 0, 0, 0, 108, 111, 3, 24, 12, 0, 109, 111, 5, 20, 0, 0, 110, 108, 1, 0, 0, 0, 110, 109, 1, 0, 0, 0, 111, 17, 1, 0, 0, 0, 112, 116, 3, 24, 12, 0, 113, 116, 3, 20, 10, 0, 114, 116, 5, 20, 0, 0, 115, 112, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 19, 1, 0, 0, 0, 117, 118, 7, 1, 0, 0, 118, 21, 1, 0, 0, 0, 119, 120, 7, 2, 0, 0, 120, 23, 1, 0, 0, 0, 121, 124, 3, 22, 11, 0, 122, 124, 5, 17, 0, 0, 123, 121, 1, 0, 0, 0, 123, 122, 1, 0, 0, 0, 124, 25, 1, 0, 0, 0, 125, 128, 3, 24, 12, 0, 126, 128, 5, 11, 0, 0, 127, 125, 1, 0, 0, 0, 127, 126, 1, 0, 0, 0, 128, 27, 1, 0, 0, 0, 16, 31, 34, 39, 45, 54, 63, 66, 72, 82, 90, 92, 106, 110, 115, 123, 127]
[4, 1, 21, 130, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 4, 0, 30, 8, 0, 11, 0, 12, 0, 31, 1, 0, 3, 0, 35, 8, 0, 1, 0, 5, 0, 38, 8, 0, 10, 0, 12, 0, 41, 9, 0, 1, 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 55, 8, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 64, 8, 3, 1, 3, 3, 3, 67, 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 73, 8, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 83, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 91, 8, 5, 10, 5, 12, 5, 94, 9, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 107, 8, 7, 1, 8, 1, 8, 3, 8, 111, 8, 8, 1, 9, 1, 9, 1, 9, 3, 9, 116, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 124, 8, 12, 1, 13, 1, 13, 3, 13, 128, 8, 13, 1, 13, 0, 1, 10, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 12, 13, 1, 0, 18, 19, 2, 0, 4, 6, 8, 10, 132, 0, 29, 1, 0, 0, 0, 2, 50, 1, 0, 0, 0, 4, 56, 1, 0, 0, 0, 6, 59, 1, 0, 0, 0, 8, 74, 1, 0, 0, 0, 10, 82, 1, 0, 0, 0, 12, 95, 1, 0, 0, 0, 14, 106, 1, 0, 0, 0, 16, 110, 1, 0, 0, 0, 18, 115, 1, 0, 0, 0, 20, 117, 1, 0, 0, 0, 22, 119, 1, 0, 0, 0, 24, 123, 1, 0, 0, 0, 26, 127, 1, 0, 0, 0, 28, 30, 3, 2, 1, 0, 29, 28, 1, 0, 0, 0, 30, 31, 1, 0, 0, 0, 31, 29, 1, 0, 0, 0, 31, 32, 1, 0, 0, 0, 32, 34, 1, 0, 0, 0, 33, 35, 3, 4, 2, 0, 34, 33, 1, 0, 0, 0, 34, 35, 1, 0, 0, 0, 35, 39, 1, 0, 0, 0, 36, 38, 3, 6, 3, 0, 37, 36, 1, 0, 0, 0, 38, 41, 1, 0, 0, 0, 39, 37, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 45, 1, 0, 0, 0, 41, 39, 1, 0, 0, 0, 42, 44, 3, 12, 6, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 51, 5, 4, 0, 0, 51, 54, 5, 18, 0, 0, 52, 53, 5, 5, 0, 0, 53, 55, 3, 24, 12, 0, 54, 52, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 57, 5, 7, 0, 0, 57, 58, 5, 18, 0, 0, 58, 5, 1, 0, 0, 0, 59, 60, 5, 8, 0, 0, 60, 66, 5, 18, 0, 0, 61, 63, 5, 5, 0, 0, 62, 64, 3, 8, 4, 0, 63, 62, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 67, 3, 24, 12, 0, 66, 61, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 69, 5, 9, 0, 0, 69, 72, 3, 26, 13, 0, 70, 71, 5, 6, 0, 0, 71, 73, 3, 24, 12, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 7, 1, 0, 0, 0, 74, 75, 7, 0, 0, 0, 75, 9, 1, 0, 0, 0, 76, 77, 6, 5, -1, 0, 77, 78, 5, 14, 0, 0, 78, 79, 3, 10, 5, 0, 79, 80, 5, 15, 0, 0, 80, 83, 1, 0, 0, 0, 81, 83, 3, 14, 7, 0, 82, 76, 1, 0, 0, 0, 82, 81, 1, 0, 0, 0, 83, 92, 1, 0, 0, 0, 84, 85, 10, 4, 0, 0, 85, 86, 5, 1, 0, 0, 86, 91, 3, 10, 5, 5, 87, 88, 10, 3, 0, 0, 88, 89, 5, 2, 0, 0, 89, 91, 3, 10, 5, 4, 90, 84, 1, 0, 0, 0, 90, 87, 1, 0, 0, 0, 91, 94, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 11, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 95, 96, 5, 10, 0, 0, 96, 97, 3, 10, 5, 0, 97, 98, 5, 6, 0, 0, 98, 99, 3, 24, 12, 0, 99, 13, 1, 0, 0, 0, 100, 101, 5, 16, 0, 0, 101, 107, 3, 24, 12, 0, 102, 103, 3, 16, 8, 0, 103, 104, 5, 3, 0, 0, 104, 105, 3, 18, 9, 0, 105, 107, 1, 0, 0, 0, 106, 100, 1, 0, 0, 0, 106, 102, 1, 0, 0, 0, 107, 15, 1, 0, 0, 0, 108, 111, 3, 24, 12, 0, 109, 111, 5, 20, 0, 0, 110, 108, 1, 0, 0, 0, 110, 109, 1, 0, 0, 0, 111, 17, 1, 0, 0, 0, 112, 116, 3, 24, 12, 0, 113, 116, 3, 20, 10, 0, 114, 116, 5, 20, 0, 0, 115, 112, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 19, 1, 0, 0, 0, 117, 118, 7, 1, 0, 0, 118, 21, 1, 0, 0, 0, 119, 120, 7, 2, 0, 0, 120, 23, 1, 0, 0, 0, 121, 124, 3, 22, 11, 0, 122, 124, 5, 17, 0, 0, 123, 121, 1, 0, 0, 0, 123, 122, 1, 0, 0, 0, 124, 25, 1, 0, 0, 0, 125, 128, 3, 24, 12, 0, 126, 128, 5, 11, 0, 0, 127, 125, 1, 0, 0, 0, 127, 126, 1, 0, 0, 0, 128, 27, 1, 0, 0, 0, 16, 31, 34, 39, 45, 54, 63, 66, 72, 82, 90, 92, 106, 110, 115, 123, 127]

File diff suppressed because one or more lines are too long