From 56a3be19a3b10ff21700162f6bf685ea19f216e5 Mon Sep 17 00:00:00 2001 From: Gonzalo Diaz Date: Tue, 6 Jan 2026 00:08:08 -0300 Subject: [PATCH 1/3] AI driven dependency-issues fixed. --- .github/workflows/go-lint.yml | 12 +++--------- .github/workflows/go-test.yml | 2 +- Makefile | 20 ++++++++++++++++++-- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index 5a230d9..d8878e5 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: os: ["windows-2022", "ubuntu-24.04", "macos-14"] - go: ["1.24.x", "1.25.x"] + go: ["1.23.x", "1.24.x", "1.25.x"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 @@ -32,14 +32,8 @@ jobs: - run: go version - - name: Test Styling (gofmt) - run: gofmt -l . && echo '✔ Your code looks good.' - - # yamllint disable rule:line-length - - name: Test Styling (analysis/modernize) Analyzer modernize - if: ${{ ! startsWith(matrix.go, '1.22') }} - run: go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -test ./... - # yamllint enable rule:line-length + - name: Test Styling (gofmt & modernize) + run: make test/styling - name: Lint (go vet) run: go vet -v ./... diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 5632c09..a4ced3d 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: os: ["windows-2022", "ubuntu-24.04", "macos-14"] - go: ["1.24.x", "1.25.x"] + go: ["1.23.x", "1.24.x", "1.25.x"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 diff --git a/Makefile b/Makefile index 15441a1..e552a1a 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,22 @@ PKG_LIST=$(go list ./... | grep -v /vendor/ | tr '\n' ' '| xargs echo -n) BUILDKIT_PROGRESS=plain CGO_ENABLED=0 +# Modernize tool versioning +# Go 1.25 requires gopls v0.21.0+ +# Go 1.24 and below should use gopls v0.20.0 +GO_VERSION := $(shell go version | cut -d' ' -f3 | sed 's/go//') +MODERNIZE_VER := v0.20.0 + +# Check if Go version is 1.25 or higher +IS_GO_125 := $(shell echo "$(GO_VERSION)" | awk -F. '{if ($$1 > 1 || ($$1 == 1 && $$2 >= 25)) print 1; else print 0}') + +ifeq ($(IS_GO_125),1) + MODERNIZE_VER := latest +endif + +# Use GOTOOLCHAIN=auto to ensure the required toolchain is available if needed +MODERNIZE_CMD := GOTOOLCHAIN=auto $(GO) run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@$(MODERNIZE_VER) + .MAIN: test/coverage .PHONY: all clean coverage dependencies help list test .EXPORT_ALL_VARIABLES: # (2) @@ -82,10 +98,10 @@ test/static: dependencies test/styling: dependencies gofmt -l . && echo '✔ Your code looks good.' - $(GO) run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -test ./... + $(MODERNIZE_CMD) -test ./... format: - $(GO) run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix ./... + $(MODERNIZE_CMD) -fix ./... coverage.out: env dependencies $(GOTEST) -v -covermode=atomic -coverprofile="coverage.out" ./exercises/... From 060956fd66e5f13919102c54c1160fc1a6416baf Mon Sep 17 00:00:00 2001 From: Gonzalo Diaz Date: Tue, 16 Dec 2025 12:11:53 -0300 Subject: [PATCH 2/3] [CONFIG] [Docker] Now use fixed version of markdownlint --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 22dde96..6c2b000 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ WORKDIR ${WORKDIR} RUN apk add --update --no-cache make nodejs npm wget \ && apk add --update --no-cache yamllint \ - && npm install -g --ignore-scripts markdownlint-cli + && npm install -g --ignore-scripts markdownlint-cli@0.47.0 ADD https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh ${WORKDIR}/ RUN sh install.sh -b $(go env GOPATH)/bin v2.0.0 \ From b8cda541842ee98c73ea2f97637f802c5948f7bb Mon Sep 17 00:00:00 2001 From: Gonzalo Diaz Date: Tue, 16 Dec 2025 12:15:33 -0300 Subject: [PATCH 3/3] [lint] markdownlint fixes --- README.md | 4 ++-- .../dictionaries_and_hashmaps/ctci-ransom-note.md | 3 ++- .../greedy_algorithms/angry-children.md | 3 ++- .../greedy_algorithms/greedy-florist.md | 3 ++- docs/projecteuler/problem0002.md | 3 ++- docs/projecteuler/problem0020.md | 3 ++- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ee2c74d..776c874 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,8 @@ You can run tests in the following ways: installed in your SO. - [Install and run with make](#install-and-run-using-make) require runtime tools and "make" installed in your SO. -- [Install and run in Docker](#install-and-running-with-docker-) require Docker and -docker-compose installed. +- [Install and run in Docker](#install-and-running-with-docker-) require Docker + and docker-compose installed. - (⭐️) [Install and in Docker with make](#install-and-running-with-docker--using-make) require docker-compose and make installed. diff --git a/docs/hackerrank/interview_preparation_kit/dictionaries_and_hashmaps/ctci-ransom-note.md b/docs/hackerrank/interview_preparation_kit/dictionaries_and_hashmaps/ctci-ransom-note.md index 1e9df62..770a064 100644 --- a/docs/hackerrank/interview_preparation_kit/dictionaries_and_hashmaps/ctci-ransom-note.md +++ b/docs/hackerrank/interview_preparation_kit/dictionaries_and_hashmaps/ctci-ransom-note.md @@ -49,7 +49,8 @@ The third line contains `n` space-separated strings, each `node[i]`. - $ 1 \leq m, n \leq 30000 $ - $ 1 \leq $ length of `magazine[i]` and `note[i]` $ \leq 5 $ -- Each word consists of English alphabetic letters (i.e., `a` to `z` and `A` to `Z`). +- Each word consists of English alphabetic letters (i.e., `a` to `z` and `A` to + `Z`). ## Sample Input 0 diff --git a/docs/hackerrank/interview_preparation_kit/greedy_algorithms/angry-children.md b/docs/hackerrank/interview_preparation_kit/greedy_algorithms/angry-children.md index 1177d8e..a9d8abd 100644 --- a/docs/hackerrank/interview_preparation_kit/greedy_algorithms/angry-children.md +++ b/docs/hackerrank/interview_preparation_kit/greedy_algorithms/angry-children.md @@ -140,4 +140,5 @@ max(1,2,3,4) - min(1,2,3,4) = 4 - 1 = 3 ## Explanation 2 -Here `k = 2`. `arr' = [2, 2]` or `arr' = [1, 1]` give the minimum unfairness of `0`. +Here `k = 2`. `arr' = [2, 2]` or `arr' = [1, 1]` give the minimum unfairness +of `0`. diff --git a/docs/hackerrank/interview_preparation_kit/greedy_algorithms/greedy-florist.md b/docs/hackerrank/interview_preparation_kit/greedy_algorithms/greedy-florist.md index c5d6e78..9b42665 100644 --- a/docs/hackerrank/interview_preparation_kit/greedy_algorithms/greedy-florist.md +++ b/docs/hackerrank/interview_preparation_kit/greedy_algorithms/greedy-florist.md @@ -74,7 +74,8 @@ the original price of each flower. ## Explanation 0 -There are `n = 3` flowers with costs `c = [2, 5, ,6]` and `k = 3` people in the group. +There are `n = 3` flowers with costs `c = [2, 5, ,6]` and `k = 3` people +in the group. If each person buys one flower, the total cost of prices paid is `2 + 5 + 6 = 13` dollars. Thus, we print `13` as our answer. diff --git a/docs/projecteuler/problem0002.md b/docs/projecteuler/problem0002.md index 34abbf2..4ba89bf 100644 --- a/docs/projecteuler/problem0002.md +++ b/docs/projecteuler/problem0002.md @@ -1,6 +1,7 @@ # [Even Fibonacci numbers](https://projecteuler.net/problem=2) -Each new term in the Fibonacci sequence is generated by adding the previous two terms. +Each new term in the Fibonacci sequence is generated by adding the previous +two terms. By starting with 1 and 2, the first 10 terms will be: $ 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... $ diff --git a/docs/projecteuler/problem0020.md b/docs/projecteuler/problem0020.md index 5c1e200..1eff679 100644 --- a/docs/projecteuler/problem0020.md +++ b/docs/projecteuler/problem0020.md @@ -3,6 +3,7 @@ $ n! $ means $ n × (n − 1) × ... × 3 × 2 × 1 $ For example, $ 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800 $, -and the sum of the digits in the number $ 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27 $. +and the sum of the digits in the number $ 10! $ is +$ 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27 $. Find the sum of the digits in the number $ 100! $