Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/pipes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Pipes

on:
pull_request:
branches:
- master
paths:
- '**.go'
types:
- labeled
- unlabeled
- opened
- synchronize
push:
branches:
- master
paths:
- '**.go'

env:
GO_VERSION: stable
GOLANGCI_LINT_VERSION: v2.6.1

jobs:
build:
runs-on: ubuntu-latest
if: |
github.event_name == 'push'
|| (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci'))
steps:
- uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Taskfile
run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
- name: Install deps
run: go mod download
- name: Build
run: GOPATH=$(pwd) ./bin/task release

lint:
runs-on: ubuntu-latest
if: |
github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci')
timeout-minutes: 3
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Lint
uses: golangci/golangci-lint-action@v9
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}

test:
runs-on: ubuntu-latest
if: |
github.event_name == 'push'
|| (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci'))
steps:
- uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Test
run: go test ./...
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
!.editorconfig
!.gitattributes
!.gitignore
!.golangci.yaml

!.github/
28 changes: 28 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "2"
linters:
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
- (.+)_test\.go
settings:
staticcheck:
checks:
- all
- '-SA1019'
formatters:
enable:
- gofmt
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
10 changes: 0 additions & 10 deletions Makefile

This file was deleted.

45 changes: 45 additions & 0 deletions Taskfile.dist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: '3'

vars:
VERSION:
sh: git describe --tags|sed -e "s/\-/\./g"
BUILD:
sh: date +%FT%T%z
COMMIT:
sh: git rev-parse HEAD
TARGETDIR:
sh: echo $GOPATH/bin
BIN: 'goimportcycle'
PROJECT_PROTO_INCLUDE:
sh: cd .. && pwd
PROJECT_PROTO_OUT:
sh: cd ../../../ && pwd

tasks:
clean:
cmds:
- rm -f {{.TARGETDIR}}/{{.BIN}}

release:
cmds:
- go build {{.LDFLAGS}} -o {{.TARGETDIR}}/{{.BIN}} ./cmd/{{.BIN}}
vars:
LDFLAGS: -ldflags "-X main.Date={{.BUILD}} -X main.Commit={{.COMMIT}}"

debug:
cmds:
- go build {{.LDFLAGS}} -o {{.TARGETDIR}}/{{.BIN}} ./cmd/{{.BIN}}
vars:
LDFLAGS: -ldflags "-s -w -X main.Version={{.VERSION}} -X main.Date={{.BUILD}} -X main.Commit={{.COMMIT}}"

generate-examples:
cmds:
- ./scripts/generate-examples.sh

lint:
cmds:
- golangci-lint run ./...

test:
cmds:
- go test ./...
2 changes: 1 addition & 1 deletion assets/examples/independent/file.dot
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ digraph {
"pkg_main_file_main" [label="main.go", style="filled", fontcolor="#000000", fillcolor="#ffffff"];
};

"pkg_a_file_a" -> "pkg_c_file_c" [color="#ff0000"];
"pkg_a_file_a" -> "pkg_b_file_b" [color="#ff0000"];
"pkg_a_file_a" -> "pkg_c_file_c" [color="#ff0000"];
"pkg_b_file_b" -> "pkg_a_file_a" [color="#ff0000"];
"pkg_c_file_c" -> "pkg_a_file_a" [color="#ff0000"];
"pkg_main_file_main" -> "pkg_a_file_a" [color="#000000"];
Expand Down
2 changes: 1 addition & 1 deletion assets/examples/interlinked/file.dot
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ digraph {
};

"pkg_a_file_a" -> "pkg_b_file_b" [color="#ff0000"];
"pkg_b_file_b" -> "pkg_a_file_a" [color="#ff0000"];
"pkg_b_file_b" -> "pkg_c_file_c" [color="#ff0000"];
"pkg_b_file_b" -> "pkg_a_file_a" [color="#ff0000"];
"pkg_c_file_c" -> "pkg_b_file_b" [color="#ff0000"];
"pkg_main_file_main" -> "pkg_a_file_a" [color="#000000"];
}
8 changes: 6 additions & 2 deletions assets/examples/none/file.dot
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ digraph {
fontcolor="#000000";
fillcolor="#ffffff";

"pkg_c_file_c" [label="c.go", style="filled", fontcolor="#000000", fillcolor="#ffffff"];
"pkg_c_file_c_1" [label="c_1.go", style="filled", fontcolor="#000000", fillcolor="#ffffff"];
"pkg_c_file_c_2" [label="c_2.go", style="filled", fontcolor="#000000", fillcolor="#ffffff"];
"pkg_c_file_c_3" [label="c_3.go", style="filled", fontcolor="#000000", fillcolor="#ffffff"];
};

subgraph "cluster_pkg_main" {
Expand All @@ -41,6 +43,8 @@ digraph {
};

"pkg_b_file_b" -> "pkg_a_file_a" [color="#000000"];
"pkg_c_file_c" -> "pkg_b_file_b" [color="#000000"];
"pkg_c_file_c_1" -> "pkg_b_file_b" [color="#000000"];
"pkg_c_file_c_2" -> "pkg_b_file_b" [color="#000000"];
"pkg_c_file_c_3" -> "pkg_b_file_b" [color="#000000"];
"pkg_main_file_main" -> "pkg_a_file_a" [color="#000000"];
}
Binary file modified assets/examples/none/file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading