-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 68655ed
Showing
26 changed files
with
795 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: golangci-lint | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.17 | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | ||
version: v1.50.1 | ||
working-directory: golang | ||
args: -v --print-resources-usage --timeout=180s --config=.golangci.yml | ||
- name: Test | ||
run: | | ||
cd golang | ||
go test -count=1 -p 1 -v ./... | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Python package | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
cd ./python | ||
pip install -r requirements.txt | ||
- name: Lint with flake8 | ||
run: | | ||
cd ./python | ||
flake8 ./ | ||
- name: Lint with MyPy | ||
run: | | ||
cd ./python | ||
mypy ./ | ||
- name: Test with unittest | ||
run: | | ||
cd ./python | ||
python -m unittest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Репозиторий для работ по курсу информатика | ||
|
||
Вот сюда нужно будет в первой работе с гитом добавит свое ФИО | ||
|
||
## ФИО | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
## Работа с репозиторием | ||
|
||
В репозитории присутствуют 2 каталога - для рабработчиков на python и golang. | ||
|
||
Необходимо выбрать ваш стек и в соответствующем каталоге открыть файл проекта `informatics.code-workspace` через vscode. | ||
Для тех, кто использует другие среды разработки - пишите в чат, попробуем помочь настроить. Дальнейшие инструкции для каждого | ||
соответствующего проекта находятся в соответствующем `README.md` файле проекта. | ||
|
||
## Примеры работы с markdown | ||
|
||
Обычный текст. | ||
Еще текст на той же строке (в том же абзаце). | ||
|
||
Текст в новом абзаце | ||
|
||
## Подзаголовок | ||
|
||
``` | ||
Блок кода | ||
``` | ||
|
||
```python | ||
print("Hello world") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
run: | ||
tests: false | ||
skip-files: | ||
- \.pb\.go$ | ||
- \.pb\.validate\.go$ | ||
- \.pb\.gw\.go$ | ||
|
||
linters-settings: | ||
dupl: | ||
threshold: 500 | ||
# commented linter rules should be uncommented when corresponding linter will be enabled | ||
# funlen: | ||
# lines: 160 | ||
# statements: 60 | ||
gci: | ||
local-prefixes: github.com/golangci/golangci-lint | ||
# revive: | ||
# min-confidence: 0 | ||
# gomnd: | ||
# checks: | ||
# - argument | ||
# - case | ||
# - condition | ||
# - return | ||
lll: | ||
line-length: 160 | ||
|
||
linters: | ||
# please, do not use `enable-all`: it's deprecated and will be removed soon. | ||
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint | ||
# Disabled linters should be enabled later | ||
disable-all: true | ||
enable: | ||
- asciicheck | ||
- bidichk | ||
- bodyclose | ||
- containedctx | ||
# - deadcode | ||
- decorder | ||
- depguard | ||
- dogsled | ||
- dupl | ||
- durationcheck | ||
# - errcheck | ||
- errchkjson | ||
# - errname | ||
- errorlint | ||
- execinquery | ||
- exportloopref | ||
# - forbidigo | ||
- forcetypeassert | ||
# - funlen | ||
- gocognit | ||
- goconst | ||
# - gocritic | ||
- gocyclo | ||
# - gofmt | ||
# - gofumpt | ||
- goheader | ||
# - goimports | ||
# - gomnd | ||
- gomodguard | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- grouper | ||
# - ifshort | ||
- importas | ||
- ineffassign | ||
- lll | ||
# - maintidx | ||
- makezero | ||
# - misspell | ||
- nakedret | ||
- nestif | ||
- nilerr | ||
- nilnil | ||
- noctx | ||
# - nolintlint | ||
- nosprintfhostport | ||
- paralleltest | ||
# - prealloc | ||
# - predeclared | ||
- promlinter | ||
# - revive | ||
- rowserrcheck | ||
- sqlclosecheck | ||
# - structcheck | ||
# - stylecheck | ||
# - tagliatelle | ||
- tenv | ||
- testpackage | ||
- tparallel | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
# - varcheck | ||
- wastedassign | ||
- whitespace | ||
|
||
issues: | ||
# Excluding configuration per-path, per-linter, per-text and per-source | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- gomnd | ||
- text: "File is not `goimports`-ed with -local github.com/golangci/golangci-lint" | ||
linters: | ||
- goimports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Launch Package", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "auto", | ||
"program": "${fileDirname}", | ||
"console": "integratedTerminal", | ||
"args": ["sample"], | ||
"showLog": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"go.lintTool": "golangci-lint", | ||
"go.lintFlags": ["--fast"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Работа с проектом | ||
|
||
`vscode` при старте предложит установить рекомендованныек расширения - с ним лучше согласиться. | ||
|
||
|
||
## Настройка окружения | ||
|
||
### Golang | ||
|
||
Установите `golang` для соответствующей операционной системы. | ||
|
||
Запустите выкачивание зависимостей | ||
|
||
```shell | ||
go mod tidy | ||
``` | ||
|
||
Для локальной проверки линтером следует установить линтер. Устанавливать следует из git bash терминала в случае `windows` | ||
|
||
```shell | ||
# binary will be $(go env GOPATH)/bin/golangci-lint | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.1 | ||
``` | ||
|
||
Для запуска линтера следует выполнить следующую команду | ||
```shell | ||
$(go env GOPATH)/bin/golangci-lint run -vvv --out-format tab --print-resources-usage --timeout=180s --config=.golangci.yml | ||
``` | ||
|
||
### Запуск тестов | ||
|
||
```shell | ||
go test -count=1 -p 1 -v ./... | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module isuct.ru/informatics2022 | ||
|
||
go 1.16 | ||
|
||
require github.com/stretchr/testify v1.8.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= | ||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= | ||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= | ||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= | ||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | ||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "." | ||
}, | ||
], | ||
"settings": { | ||
"files.exclude": { | ||
"**/.git": true, | ||
}, | ||
}, | ||
"extensions": { | ||
"recommendations": [ | ||
"golang.go", | ||
"eamodio.gitlens" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package internal | ||
|
||
func Summ(a, b int) int { | ||
return a + b | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package main | ||
|
||
import "fmt" | ||
|
||
func main() { | ||
fmt.Println("Hello world") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package internal_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"isuct.ru/informatics2022/internal" | ||
) | ||
|
||
func TestSumm(t *testing.T) { | ||
summ := internal.Summ(2, 3) | ||
if summ != 5 { | ||
t.Fatalf(`Summ(2,3) = %d, want 5, error`, summ) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[flake8] | ||
ignore = E722 | ||
max-line-length = 128 |
Oops, something went wrong.
Калядина Алина Олеговна