From 7828e110461b0683769731a6d574e2c77615dcd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=27Kama=C5=9B=27=20Bruchal?= Date: Wed, 17 Jun 2026 18:53:54 +0200 Subject: [PATCH] Initial commit --- .golangci.yml | 43 +++++++++++++++++++++++++++++++++++++++++ .markdownlint-cli2.yaml | 21 ++++++++++++++++++++ .pre-commit-config.yaml | 18 +++++++++++++++++ Dockerfile | 0 README.md | 0 fetch-sheet.go | 0 main.go | 0 scheduler.go | 0 8 files changed, 82 insertions(+) create mode 100644 .golangci.yml create mode 100644 .markdownlint-cli2.yaml create mode 100644 .pre-commit-config.yaml create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 fetch-sheet.go create mode 100644 main.go create mode 100644 scheduler.go diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..6fd58bf --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,43 @@ +version: "2" + +linters: + default: standard # errcheck, govet, staticcheck, unused, ineffassign + enable: + # --- general additions --- + - gocritic + - revive + - errorlint + - gosec + - unconvert + - misspell + # --- HTTP / API-client (Sheets + Telegram) --- + - bodyclose # unclosed response Body -> fd/conn leak + - noctx # request built without context + - errchkjson # unmarshalable types into json.Marshal + - canonicalheader # non-canonical net/http.Header keys + # --- context discipline (the real delta for this workload) --- + - contextcheck # don't drop the inherited ctx for Background/TODO + - fatcontext # nested/repeated ctx wrapping inside loops + - containedctx # ctx stored in a struct field (anti-pattern) + # --- uncomment if you persist bot state in SQL --- + # - rowserrcheck + # - sqlclosecheck + + settings: + errcheck: + check-type-assertions: true + misspell: + locale: US + + exclusions: + rules: + - path: _test\.go + linters: + - gosec + - errcheck + +formatters: + enable: + - gofmt + - goimports + # - gofumpt diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 0000000..fb4f939 --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,21 @@ +# markdownlint-cli2 configuration +# https://github.com/DavidAnson/markdownlint-cli2 + +globs: + - "**/*.md" + +ignores: + - "vendor/**" + - "node_modules/**" + +config: + # Allow long lines — documentation often has URLs and tables + MD013: false + # Allow duplicate headings in different sections + MD024: + siblings_only: true + # Allow trailing punctuation in headings + MD026: + punctuation: ".,;:!" + # Allow inline HTML when needed + MD033: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..2d8f5f9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +repos: + - repo: https://github.com/DavidAnson/markdownlint-cli2 + rev: v0.22.0 + hooks: + - id: markdownlint-cli2 + + - repo: https://github.com/dnephin/pre-commit-golang + rev: v0.5.1 + hooks: + - id: go-fmt + - id: golangci-lint + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-merge-conflict diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/fetch-sheet.go b/fetch-sheet.go new file mode 100644 index 0000000..e69de29 diff --git a/main.go b/main.go new file mode 100644 index 0000000..e69de29 diff --git a/scheduler.go b/scheduler.go new file mode 100644 index 0000000..e69de29