mirror of
https://github.com/safedep/vet.git
synced 2025-12-10 00:22:08 -06:00
Remove Markdown Builder in Favor of DRY Markdown Builder (#608)
* Initial plan * Replace local markdown package with dry library version - Updated dry dependency to v0.0.0-20250916040320-209e39edc57f (latest) - Replaced imports from pkg/reporter/markdown to dry/reporting/markdown - Removed local pkg/reporter/markdown directory - All tests passing, build successful Co-authored-by: abhisek <31844+abhisek@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: abhisek <31844+abhisek@users.noreply.github.com> Co-authored-by: Kunal Singh <kunalsin9h@gmail.com>
This commit is contained in:
parent
8671c25fb5
commit
d5a64a4f61
21
go.mod
21
go.mod
@ -19,9 +19,9 @@ require (
|
||||
github.com/charmbracelet/glamour v0.8.0
|
||||
github.com/charmbracelet/lipgloss v1.1.0
|
||||
github.com/cli/oauth v1.2.0
|
||||
github.com/cloudwego/eino v0.3.47
|
||||
github.com/cloudwego/eino v0.4.7
|
||||
github.com/cloudwego/eino-ext/components/model/claude v0.1.1
|
||||
github.com/cloudwego/eino-ext/components/model/gemini v0.1.1
|
||||
github.com/cloudwego/eino-ext/components/model/gemini v0.1.5
|
||||
github.com/cloudwego/eino-ext/components/model/openai v0.0.0-20250707040601-2fab92740585
|
||||
github.com/cloudwego/eino-ext/components/tool/mcp v0.0.3
|
||||
github.com/deepmap/oapi-codegen v1.16.3
|
||||
@ -51,14 +51,14 @@ require (
|
||||
github.com/pandatix/go-cvss v0.6.2
|
||||
github.com/posthog/posthog-go v1.5.11
|
||||
github.com/safedep/code v0.0.0-20250619080228-57f5b7b5e58c
|
||||
github.com/safedep/dry v0.0.0-20250716064316-9afa8962ced6
|
||||
github.com/safedep/dry v0.0.0-20250916040320-209e39edc57f
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/smacker/go-tree-sitter v0.0.0-20240827094217-dd81d9e9be82
|
||||
github.com/spdx/tools-golang v0.5.5
|
||||
github.com/spf13/cobra v1.10.1
|
||||
github.com/stretchr/testify v1.11.1
|
||||
golang.org/x/oauth2 v0.30.0
|
||||
google.golang.org/genai v1.14.0
|
||||
google.golang.org/genai v1.21.0
|
||||
google.golang.org/grpc v1.72.2
|
||||
google.golang.org/protobuf v1.36.8
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
@ -145,6 +145,7 @@ require (
|
||||
github.com/aws/smithy-go v1.22.2 // indirect
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
||||
github.com/aymerick/douceur v0.2.0 // indirect
|
||||
github.com/bahlo/generic-list-go v0.2.0 // indirect
|
||||
github.com/becheran/wildmatch-go v1.0.0 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bkielbasa/cyclop v1.2.3 // indirect
|
||||
@ -155,6 +156,7 @@ require (
|
||||
github.com/breml/bidichk v0.3.2 // indirect
|
||||
github.com/breml/errchkjson v0.4.0 // indirect
|
||||
github.com/briandowns/spinner v1.23.2 // indirect
|
||||
github.com/buger/jsonparser v1.1.1 // indirect
|
||||
github.com/butuzov/ireturn v0.3.1 // indirect
|
||||
github.com/butuzov/mirror v1.3.0 // indirect
|
||||
github.com/bytedance/sonic v1.14.0 // indirect
|
||||
@ -205,6 +207,7 @@ require (
|
||||
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/edsrzf/mmap-go v1.2.0 // indirect
|
||||
github.com/eino-contrib/jsonschema v1.0.0 // indirect
|
||||
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
|
||||
github.com/erikvarga/go-rpmdb v0.0.0-20250523120114-a15a62cd4593 // indirect
|
||||
github.com/ettle/strcase v0.2.0 // indirect
|
||||
@ -232,8 +235,8 @@ require (
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-openapi/inflect v0.21.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
||||
github.com/go-openapi/swag v0.19.5 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.26.0 // indirect
|
||||
@ -268,9 +271,10 @@ require (
|
||||
github.com/gomarkdown/markdown v0.0.0-20250311123330-531bef5e742b // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/google/go-containerregistry v0.20.5 // indirect
|
||||
github.com/google/go-github/v74 v74.0.0 // indirect
|
||||
github.com/google/go-querystring v1.1.0 // indirect
|
||||
github.com/google/licensecheck v0.3.1 // indirect
|
||||
github.com/google/pprof v0.0.0-20250501235452-c0086092b71a // indirect
|
||||
github.com/google/pprof v0.0.0-20250602020802-c6617b811d0e // indirect
|
||||
github.com/google/s2a-go v0.1.9 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.14.2 // indirect
|
||||
@ -390,7 +394,7 @@ require (
|
||||
github.com/opencontainers/selinux v1.12.0 // indirect
|
||||
github.com/pborman/indent v1.2.1 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
||||
github.com/perimeterx/marshmallow v1.1.4 // indirect
|
||||
github.com/perimeterx/marshmallow v1.1.5 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
||||
github.com/piprate/json-gold v0.5.0 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
@ -474,6 +478,7 @@ require (
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
|
||||
github.com/wagoodman/go-partybus v0.0.0-20230516145632-8ccac152c651 // indirect
|
||||
github.com/wagoodman/go-progress v0.0.0-20230925121702-07e42b3cdba0 // indirect
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
|
||||
github.com/xen0n/gosmopolitan v1.2.2 // indirect
|
||||
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
|
||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
||||
|
||||
39
go.sum
39
go.sum
@ -263,6 +263,8 @@ github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWp
|
||||
github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA=
|
||||
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
|
||||
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
|
||||
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
|
||||
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
|
||||
github.com/becheran/wildmatch-go v1.0.0 h1:mE3dGGkTmpKtT4Z+88t8RStG40yN9T+kFEGj2PZFSzA=
|
||||
github.com/becheran/wildmatch-go v1.0.0/go.mod h1:gbMvj0NtVdJ15Mg/mH9uxk2R1QCistMyU7d9KFzroX4=
|
||||
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
@ -294,6 +296,8 @@ github.com/breml/errchkjson v0.4.0 h1:gftf6uWZMtIa/Is3XJgibewBm2ksAQSY/kABDNFTAd
|
||||
github.com/breml/errchkjson v0.4.0/go.mod h1:AuBOSTHyLSaaAFlWsRSuRBIroCh3eh7ZHh5YeelDIk8=
|
||||
github.com/briandowns/spinner v1.23.2 h1:Zc6ecUnI+YzLmJniCfDNaMbW0Wid1d5+qcTq4L2FW8w=
|
||||
github.com/briandowns/spinner v1.23.2/go.mod h1:LaZeM4wm2Ywy6vO571mvhQNRcWfRUnXOs0RcKV0wYKM=
|
||||
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
|
||||
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
||||
github.com/bugsnag/bugsnag-go v1.4.0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
|
||||
github.com/bugsnag/panicwrap v1.2.0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
|
||||
github.com/butuzov/ireturn v0.3.1 h1:mFgbEI6m+9W8oP/oDdfA34dLisRFCj2G6o/yiI1yZrY=
|
||||
@ -374,12 +378,12 @@ github.com/cli/safeexec v1.0.0/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=
|
||||
github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=
|
||||
github.com/cloudwego/eino v0.3.47 h1:nl1Q1QZhFAyl169M32KZB8vj1Zp6fqeSjVF1lVzUSsw=
|
||||
github.com/cloudwego/eino v0.3.47/go.mod h1:wUjz990apdsaOraOXdh6CdhVXq8DJsOvLsVlxNTcNfY=
|
||||
github.com/cloudwego/eino v0.4.7 h1:wwqsFWCuzCQuhw1dYKqHjGWULzjDjFfN9sTn/cezYV4=
|
||||
github.com/cloudwego/eino v0.4.7/go.mod h1:1TDlOmwGSsbCJaWB92w9YLZi2FL0WRZoRcD4eMvqikg=
|
||||
github.com/cloudwego/eino-ext/components/model/claude v0.1.1 h1:R0Wrz8DBzhD8G8cffA2eyIcx4JEQzUnw/MHdd8KAVgQ=
|
||||
github.com/cloudwego/eino-ext/components/model/claude v0.1.1/go.mod h1:ZgBIzLGqty/XPIziZBRS01ZYZivVirUcZ4ObasrxJ/E=
|
||||
github.com/cloudwego/eino-ext/components/model/gemini v0.1.1 h1:7BTLU6Ezupa8C1RnC2qcPnVWuMUKkyhH6ctVjJZ16tM=
|
||||
github.com/cloudwego/eino-ext/components/model/gemini v0.1.1/go.mod h1:1tv89uZ9hR/4AyQ+9yxFWLn52GaJDKtPXdEY7WZdyZc=
|
||||
github.com/cloudwego/eino-ext/components/model/gemini v0.1.5 h1:uQkowZtE3l0AKWXTJgbYbJZNWG6R8sZRdtgY+EDbgmA=
|
||||
github.com/cloudwego/eino-ext/components/model/gemini v0.1.5/go.mod h1:yWVzN9Y5TU9MERRStVnfa28uXQbbAk+z/2SCi+G32Vc=
|
||||
github.com/cloudwego/eino-ext/components/model/openai v0.0.0-20250707040601-2fab92740585 h1:AHTAShrgBQnaJzIgrRZ34/+yAzEWwGINGeq+5f4N+4Q=
|
||||
github.com/cloudwego/eino-ext/components/model/openai v0.0.0-20250707040601-2fab92740585/go.mod h1:2mFQQnlhJrNgbW6YX1MOUUfXkGSbTz9Ylx37fbR0xBo=
|
||||
github.com/cloudwego/eino-ext/components/tool/mcp v0.0.3 h1:kT8yynQh8q92BPofkHxxnXslJUj5AKex5+NpMrd+BU4=
|
||||
@ -476,6 +480,8 @@ github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+m
|
||||
github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q=
|
||||
github.com/edsrzf/mmap-go v1.2.0 h1:hXLYlkbaPzt1SaQk+anYwKSRNhufIDCchSPkUD6dD84=
|
||||
github.com/edsrzf/mmap-go v1.2.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q=
|
||||
github.com/eino-contrib/jsonschema v1.0.0 h1:dXxbhGNZuI3+xNi8x3JT8AGyoXz6Pff6mRvmpjVl5Ww=
|
||||
github.com/eino-contrib/jsonschema v1.0.0/go.mod h1:cpnX4SyKjWjGC7iN2EbhxaTdLqGjCi0e9DxpLYxddD4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
@ -583,10 +589,12 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-openapi/inflect v0.21.2 h1:0gClGlGcxifcJR56zwvhaOulnNgnhc4qTAkob5ObnSM=
|
||||
github.com/go-openapi/inflect v0.21.2/go.mod h1:INezMuUu7SJQc2AyR3WO0DqqYUJSj8Kb4hBd7WtjlAw=
|
||||
github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
|
||||
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
|
||||
github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=
|
||||
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
|
||||
github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
|
||||
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
|
||||
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
|
||||
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
|
||||
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
||||
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
||||
@ -745,6 +753,8 @@ github.com/google/go-cpy v0.0.0-20211218193943-a9c933c06932 h1:5/4TSDzpDnHQ8rKEE
|
||||
github.com/google/go-cpy v0.0.0-20211218193943-a9c933c06932/go.mod h1:cC6EdPbj/17GFCPDK39NRarlMI+kt+O60S12cNB5J9Y=
|
||||
github.com/google/go-github/v70 v70.0.0 h1:/tqCp5KPrcvqCc7vIvYyFYTiCGrYvaWoYMGHSQbo55o=
|
||||
github.com/google/go-github/v70 v70.0.0/go.mod h1:xBUZgo8MI3lUL/hwxl3hlceJW1U8MVnXP3zUyI+rhQY=
|
||||
github.com/google/go-github/v74 v74.0.0 h1:yZcddTUn8DPbj11GxnMrNiAnXH14gNs559AsUpNpPgM=
|
||||
github.com/google/go-github/v74 v74.0.0/go.mod h1:ubn/YdyftV80VPSI26nSJvaEsTOnsjrxG3o9kJhcyak=
|
||||
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
|
||||
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
@ -774,8 +784,8 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe
|
||||
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=
|
||||
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
|
||||
github.com/google/pprof v0.0.0-20250501235452-c0086092b71a h1:rDA3FfmxwXR+BVKKdz55WwMJ1pD2hJQNW31d+l3mPk4=
|
||||
github.com/google/pprof v0.0.0-20250501235452-c0086092b71a/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA=
|
||||
github.com/google/pprof v0.0.0-20250602020802-c6617b811d0e h1:FJta/0WsADCe1r9vQjdHbd3KuiLPu7Y9WlyLGwMUNyE=
|
||||
github.com/google/pprof v0.0.0-20250602020802-c6617b811d0e/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0=
|
||||
github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM=
|
||||
@ -1201,8 +1211,9 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v
|
||||
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
||||
github.com/perimeterx/marshmallow v1.1.4 h1:pZLDH9RjlLGGorbXhcaQLhfuV0pFMNfPO55FuFkxqLw=
|
||||
github.com/perimeterx/marshmallow v1.1.4/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
|
||||
github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=
|
||||
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
|
||||
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=
|
||||
github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||
github.com/piprate/json-gold v0.5.0 h1:RmGh1PYboCFcchVFuh2pbSWAZy4XJaqTMU4KQYsApbM=
|
||||
@ -1286,8 +1297,8 @@ github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDj
|
||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/safedep/code v0.0.0-20250619080228-57f5b7b5e58c h1:ao6OCJyNomRFgpRtVbTEa5KetcPlinf/3rJEkL0Pgz8=
|
||||
github.com/safedep/code v0.0.0-20250619080228-57f5b7b5e58c/go.mod h1:5gnHWxq6kbun+r3qf52UHD5f9bd36sWhkDLXvPRd4ZA=
|
||||
github.com/safedep/dry v0.0.0-20250716064316-9afa8962ced6 h1:1RY9Q9ObuziUfzfN/Ov2JVNR8o4CljNemilRVSoSN8w=
|
||||
github.com/safedep/dry v0.0.0-20250716064316-9afa8962ced6/go.mod h1:JYHgU3vlgDE14Sb7NjytF+clPr+3jGCoS1HIkHn2xLE=
|
||||
github.com/safedep/dry v0.0.0-20250916040320-209e39edc57f h1:2uq7a09/h3TQ6Ii9QJDeC0KvH4zoiVDE0ZTALuwgC9k=
|
||||
github.com/safedep/dry v0.0.0-20250916040320-209e39edc57f/go.mod h1:y1jNuMe8J8T+84aEpy1NPG9r9RMxQR18v9UUT5QYd3U=
|
||||
github.com/saferwall/pe v1.5.6 h1:DrRLnoQFxHWJ5lJUmrH7X2L0xeUu6SUS95Dc61eW2Yc=
|
||||
github.com/saferwall/pe v1.5.6/go.mod h1:mJx+PuptmNpoPFBNhWs/uDMFL/kTHVZIkg0d4OUJFbQ=
|
||||
github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig=
|
||||
@ -1480,6 +1491,8 @@ github.com/wagoodman/go-partybus v0.0.0-20230516145632-8ccac152c651 h1:jIVmlAFIq
|
||||
github.com/wagoodman/go-partybus v0.0.0-20230516145632-8ccac152c651/go.mod h1:b26F2tHLqaoRQf8DywqzVaV1MQ9yvjb0OMcNl7Nxu20=
|
||||
github.com/wagoodman/go-progress v0.0.0-20230925121702-07e42b3cdba0 h1:0KGbf+0SMg+UFy4e1A/CPVvXn21f1qtWdeJwxZFoQG8=
|
||||
github.com/wagoodman/go-progress v0.0.0-20230925121702-07e42b3cdba0/go.mod h1:jLXFoL31zFaHKAAyZUh+sxiTDFe1L1ZHrcK2T1itVKA=
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
|
||||
github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg=
|
||||
github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE=
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
|
||||
@ -1988,8 +2001,8 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww
|
||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/genai v1.14.0 h1:oggc+F4l0MsRMQ1H/O2v8fXGD5B04rvd1q0GvHNsgEo=
|
||||
google.golang.org/genai v1.14.0/go.mod h1:QPj5NGJw+3wEOHg+PrsWwJKvG6UC84ex5FR7qAYsN/M=
|
||||
google.golang.org/genai v1.21.0 h1:0olX8oJPFn0iXNV4cNwgdvc4NHGTZpUbhGhu6Y/zh7U=
|
||||
google.golang.org/genai v1.21.0/go.mod h1:QPj5NGJw+3wEOHg+PrsWwJKvG6UC84ex5FR7qAYsN/M=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
package markdown
|
||||
|
||||
const (
|
||||
EmojiArrowRight = ":arrow_right:"
|
||||
EmojiWhiteCheckMark = ":white_check_mark:"
|
||||
EmojiCrossMark = ":x:"
|
||||
EmojiLink = ":link:"
|
||||
EmojiWarning = ":warning:"
|
||||
EmojiRedExclamation = ":exclamation:"
|
||||
EmojiOrangeCircle = ":orange_circle:"
|
||||
EmojiRedCircle = ":red_circle:"
|
||||
EmojiInformationSource = ":information_source:"
|
||||
)
|
||||
@ -1,116 +0,0 @@
|
||||
package markdown
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type MarkdownBuilder struct {
|
||||
content bytes.Buffer
|
||||
}
|
||||
|
||||
type MarkdownCollapsibleSection struct {
|
||||
title string
|
||||
builder *MarkdownBuilder
|
||||
|
||||
// Only github for now
|
||||
flavor string
|
||||
}
|
||||
|
||||
func (s *MarkdownCollapsibleSection) Builder() *MarkdownBuilder {
|
||||
return s.builder
|
||||
}
|
||||
|
||||
func NewMarkdownBuilder() *MarkdownBuilder {
|
||||
return &MarkdownBuilder{}
|
||||
}
|
||||
|
||||
// AddHeader adds a header to the markdown document.
|
||||
func (mb *MarkdownBuilder) AddHeader(level int, text string) {
|
||||
mb.content.WriteString(fmt.Sprintf("%s %s\n", strings.Repeat("#", level), text))
|
||||
}
|
||||
|
||||
// AddParagraph adds a paragraph to the markdown document.
|
||||
func (mb *MarkdownBuilder) AddParagraph(text string) {
|
||||
mb.content.WriteString(fmt.Sprintf("%s\n\n", text))
|
||||
}
|
||||
|
||||
// AddBulletPoint adds a bullet point to the markdown document.
|
||||
func (mb *MarkdownBuilder) AddBulletPoint(text string) {
|
||||
mb.content.WriteString(fmt.Sprintf("- %s\n", text))
|
||||
}
|
||||
|
||||
// AddNumberedPoint adds a numbered point to the markdown document.
|
||||
func (mb *MarkdownBuilder) AddNumberedPoint(number int, text string) {
|
||||
mb.content.WriteString(fmt.Sprintf("%d. %s\n", number, text))
|
||||
}
|
||||
|
||||
// AddCodeSnippet adds a code snippet to the markdown document.
|
||||
func (mb *MarkdownBuilder) AddCodeSnippet(code, language string) {
|
||||
mb.content.WriteString("```" + language + "\n")
|
||||
mb.content.WriteString(code + "\n")
|
||||
mb.content.WriteString("```\n")
|
||||
}
|
||||
|
||||
func (mb *MarkdownBuilder) AddRaw(content string) {
|
||||
mb.content.WriteString("\n" + content + "\n")
|
||||
}
|
||||
|
||||
func (mb *MarkdownBuilder) AddQuote(text string) {
|
||||
mb.content.WriteString("> " + text + "\n")
|
||||
}
|
||||
|
||||
// StartCollapsibleSection starts a collapsible section in the markdown document.
|
||||
func (mb *MarkdownBuilder) StartCollapsibleSection(title string) *MarkdownCollapsibleSection {
|
||||
return &MarkdownCollapsibleSection{
|
||||
title: title,
|
||||
flavor: "github",
|
||||
builder: NewMarkdownBuilder(),
|
||||
}
|
||||
}
|
||||
|
||||
// AddCollapsibleSection adds a collapsible section to the markdown document.
|
||||
func (mb *MarkdownBuilder) AddCollapsibleSection(section *MarkdownCollapsibleSection) {
|
||||
if section.flavor != "github" {
|
||||
return
|
||||
}
|
||||
|
||||
mb.content.WriteString(fmt.Sprintf("<details>\n<summary>%s</summary>\n\n", section.title))
|
||||
mb.content.WriteString(section.builder.Build())
|
||||
mb.content.WriteString("</details>\n\n")
|
||||
}
|
||||
|
||||
func (mb *MarkdownBuilder) Build() string {
|
||||
return mb.content.String()
|
||||
}
|
||||
|
||||
var (
|
||||
headerBulletRegex = regexp.MustCompile(`(?m)^(#{1,6}\s+|[-*]\s{1,}|\d+\.\s+|>\s+)`)
|
||||
inlineCodeRegex = regexp.MustCompile("`{1,3}([^`]*)`{1,3}")
|
||||
horizontalRuleRegex = regexp.MustCompile(`(?m)^\s*(-{3,}|\*{3,}|\_{3,})\s*$`)
|
||||
boldItalicRegex = regexp.MustCompile(`(?:\*\*\*|___)(.*?)(?:\*\*\*|___)`)
|
||||
boldRegex = regexp.MustCompile(`(?:\*\*|__)(.*?)(?:\*\*|__)`)
|
||||
italicRegex = regexp.MustCompile(`(?:\*|_)(.*?)(?:\*|_)`)
|
||||
strikethroughRegex = regexp.MustCompile(`~~([^~]+)~~`)
|
||||
inlineLinkRegex = regexp.MustCompile(`\[([^\]]+)\]\((\S+?)\)`)
|
||||
imageRegex = regexp.MustCompile(`!\[([^\]]*)\]\((\S+?)\)`)
|
||||
extraSpacesRegex = regexp.MustCompile(`\s+`)
|
||||
)
|
||||
|
||||
func (mb *MarkdownBuilder) BuildPlainText() string {
|
||||
content := mb.content.String()
|
||||
content = headerBulletRegex.ReplaceAllString(content, "")
|
||||
content = inlineCodeRegex.ReplaceAllString(content, "$1")
|
||||
content = horizontalRuleRegex.ReplaceAllString(content, "")
|
||||
content = boldItalicRegex.ReplaceAllString(content, "$1")
|
||||
content = boldRegex.ReplaceAllString(content, "$1")
|
||||
content = italicRegex.ReplaceAllString(content, "$1")
|
||||
content = strikethroughRegex.ReplaceAllString(content, "$1")
|
||||
content = imageRegex.ReplaceAllString(content, "$1")
|
||||
content = inlineLinkRegex.ReplaceAllString(content, "$1")
|
||||
content = extraSpacesRegex.ReplaceAllString(content, " ")
|
||||
|
||||
return strings.Trim(content, " \n")
|
||||
}
|
||||
@ -1,88 +0,0 @@
|
||||
package markdown
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestMarkdownBuilder(t *testing.T) {
|
||||
cases := []struct {
|
||||
name string
|
||||
opsFn func(builder *MarkdownBuilder)
|
||||
contains string
|
||||
}{
|
||||
{
|
||||
"Has simple text",
|
||||
func(builder *MarkdownBuilder) {
|
||||
builder.AddParagraph("AAAABBBB")
|
||||
},
|
||||
"AAAABBBB",
|
||||
},
|
||||
{
|
||||
"Has headings h1",
|
||||
func(builder *MarkdownBuilder) {
|
||||
builder.AddHeader(1, "AAAABBBB")
|
||||
},
|
||||
"# AAAABBBB",
|
||||
},
|
||||
{
|
||||
"Has headings h2",
|
||||
func(builder *MarkdownBuilder) {
|
||||
builder.AddHeader(2, "AAAABBBB")
|
||||
},
|
||||
"## AAAABBBB",
|
||||
},
|
||||
{
|
||||
"Has bullet points",
|
||||
func(builder *MarkdownBuilder) {
|
||||
builder.AddBulletPoint("AAAA")
|
||||
builder.AddBulletPoint("BBBB")
|
||||
},
|
||||
"- AAAA\n- BBBB",
|
||||
},
|
||||
{
|
||||
"Has collapsible section",
|
||||
func(builder *MarkdownBuilder) {
|
||||
section := builder.StartCollapsibleSection("Title")
|
||||
section.Builder().AddParagraph("AAAABBBB")
|
||||
builder.AddCollapsibleSection(section)
|
||||
},
|
||||
"<details>\n<summary>Title</summary>\n\nAAAABBBB\n\n</details>",
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range cases {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
builder := NewMarkdownBuilder()
|
||||
assert.NotNil(t, builder)
|
||||
|
||||
test.opsFn(builder)
|
||||
|
||||
assert.Contains(t, builder.Build(), test.contains)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestMarkdownBuildPlainText(t *testing.T) {
|
||||
markdownText := "# Heading 1\n## Heading 2\n### Heading 3\n#### Heading 4\n" +
|
||||
"##### Heading 5\n###### Heading 6\n- Bullet list item 1 \n* Bullet list item 2\n" +
|
||||
"- Another >bullet\n1. Numbered list - item 1 \n2. Numbered list *item 2\n" +
|
||||
"> Blockquote text \n---\n___\n**Bold text1**\n__Bold text2__ \n*Italic text1*\n" +
|
||||
"_Italic text2_ \n***Bold and Italic text*** \n___Bold and Italic text___\n" +
|
||||
"~~Strikethrough text~~ \n Line #has `Inline code` betwee # n\n" +
|
||||
"Line has ``Inline code with backticks`` betwee_n \n ```Inline code in triple backticks```\n" +
|
||||
"```\nmultiline code\n```\n```python\nprint('Hello, Markdown!')\n```\n" +
|
||||
"[Link text](https://example.com)\n\n" +
|
||||
"Extra spaces in line. \n*This should be ##italic* and **this should # be #bold**.\n" +
|
||||
"~~This is crossed out~~ and `this is inline code`.\nEmoji: 🎉 🚀"
|
||||
|
||||
expectedPlainText := "Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 Bullet list item 1 Bullet list item 2 Another >bullet Numbered list - item 1 Numbered list *item 2 Blockquote text Bold text1 Bold text2 Italic text1 Italic text2 Bold and Italic text Bold and Italic text Strikethrough text Line #has Inline code betwee # n Line has Inline code with backticks betwee_n Inline code in triple backticks multiline code python print('Hello, Markdown!') Link text Image alt-text Extra spaces in line. This should be ##italic and this should # be #bold. This is crossed out and this is inline code. Emoji: 🎉 🚀"
|
||||
|
||||
builder := NewMarkdownBuilder()
|
||||
assert.NotNil(t, builder)
|
||||
|
||||
builder.AddRaw(markdownText)
|
||||
plainText := builder.BuildPlainText()
|
||||
assert.Equal(t, expectedPlainText, plainText)
|
||||
}
|
||||
@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/jedib0t/go-pretty/v6/table"
|
||||
"github.com/safedep/dry/log"
|
||||
"github.com/safedep/dry/reporting/markdown"
|
||||
"github.com/safedep/dry/utils"
|
||||
"github.com/safedep/vet/gen/checks"
|
||||
jsonreportspec "github.com/safedep/vet/gen/jsonreport"
|
||||
@ -20,7 +21,6 @@ import (
|
||||
"github.com/safedep/vet/pkg/models"
|
||||
"github.com/safedep/vet/pkg/policy"
|
||||
"github.com/safedep/vet/pkg/readers"
|
||||
"github.com/safedep/vet/pkg/reporter/markdown"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -5,12 +5,12 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/owenrumney/go-sarif/v2/sarif"
|
||||
"github.com/safedep/dry/reporting/markdown"
|
||||
"github.com/safedep/dry/utils"
|
||||
"github.com/safedep/vet/gen/checks"
|
||||
"github.com/safedep/vet/pkg/analyzer"
|
||||
"github.com/safedep/vet/pkg/common/logger"
|
||||
"github.com/safedep/vet/pkg/models"
|
||||
"github.com/safedep/vet/pkg/reporter/markdown"
|
||||
)
|
||||
|
||||
// Internal rules apart from policy violations
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user