Skip to content

Commit 426d626

Browse files
authored
Merge branch 'main' into fix-meta-character-escaping
2 parents 1d8bcaa + 78c69fd commit 426d626

File tree

13 files changed

+97
-124
lines changed

13 files changed

+97
-124
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
41+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4242

4343
- name: Install Go
4444
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
@@ -47,12 +47,12 @@ jobs:
4747

4848
# Initializes the CodeQL tools for scanning.
4949
- name: Initialize CodeQL
50-
uses: github/codeql-action/init@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
50+
uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
5151
with:
5252
languages: ${{ matrix.language }}
5353

5454
- name: Autobuild
55-
uses: github/codeql-action/autobuild@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
55+
uses: github/codeql-action/autobuild@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
5656

5757
- name: Perform CodeQL Analysis
58-
uses: github/codeql-action/autobuild@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
58+
uses: github/codeql-action/autobuild@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
os: [ubuntu-latest]
1818
runs-on: ${{ matrix.os }}
1919
steps:
20-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2121
- name: Install Go
2222
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
2323
with:

.github/workflows/regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
runs-on: ${{ matrix.os }}
3030
steps:
3131
- name: Checkout code
32-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
32+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3333
- name: Install Go
3434
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
3535
with:

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
-
2121
name: Checkout
22-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2323
with:
2424
fetch-depth: 0
2525
-
@@ -36,14 +36,14 @@ jobs:
3636
cache: true
3737
-
3838
name: Login to GitHub Container Registry
39-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
39+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
4040
with:
4141
registry: ghcr.io
4242
username: ${{ github.actor }}
4343
password: ${{ secrets.GITHUB_TOKEN }}
4444
-
4545
name: Run GoReleaser
46-
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
46+
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
4747
if: startsWith(github.ref, 'refs/tags/')
4848
with:
4949
version: latest

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
steps:
3434
- name: "Checkout code"
35-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3636
with:
3737
persist-credentials: false
3838

@@ -67,6 +67,6 @@ jobs:
6767

6868
# Upload the results to GitHub's code scanning dashboard.
6969
- name: "Upload to code-scanning"
70-
uses: github/codeql-action/upload-sarif@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
70+
uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
7171
with:
7272
sarif_file: results.sarif

cmd/util/fp_finder/fp_finder.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ package fpFinder
66
import (
77
"fmt"
88
"os"
9-
"strings"
109

1110
"github.com/spf13/cobra"
1211

1312
"github.com/coreruleset/crs-toolchain/v2/cmd/internal"
14-
"github.com/coreruleset/crs-toolchain/v2/configuration"
1513
"github.com/coreruleset/crs-toolchain/v2/util"
1614
)
1715

@@ -37,17 +35,6 @@ from stdin instead.`,
3735
return fmt.Errorf("file %s doesn't exist", filenameArg)
3836
}
3937

40-
// CLI parameter is prioritized, if not provided config file is looked up
41-
// By default will be set to DefaultDictionaryCommitRef
42-
if strings.TrimSpace(englishDictionaryCommitRef) == "" {
43-
dictionaryContext := cmdContext.RootContext().Configuration().Sources.EnglishDictionary
44-
if dictionaryContext.WasCommitRefSet {
45-
englishDictionaryCommitRef = dictionaryContext.CommitRef
46-
} else {
47-
englishDictionaryCommitRef = configuration.DefaultDictionaryCommitRef
48-
}
49-
}
50-
5138
if extendedDictPath != "" && !checkFilePath(extendedDictPath) {
5239
return fmt.Errorf("extended dictionary %s doesn't exist", extendedDictPath)
5340
}
@@ -62,7 +49,6 @@ from stdin instead.`,
6249

6350
func buildFlags(cmd *cobra.Command) {
6451
cmd.Flags().StringVarP(&extendedDictPath, "extended-dictionary", "e", "", "Absolute or relative path to the extended dictionary")
65-
cmd.Flags().StringVarP(&englishDictionaryCommitRef, "english-dictionary-commit-ref", "c", "", "English dictionary commit ref from GitHub https://github.com/dwyl/english-words/blob/master/words_alpha.txt")
6652
}
6753

6854
func checkFilePath(path string) bool {

configuration/configuration.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,9 @@ import (
1414
const DefaultDictionaryCommitRef = "refs/heads/master"
1515

1616
type Configuration struct {
17-
Sources Sources
1817
Patterns Patterns
1918
}
2019

21-
type Sources struct {
22-
EnglishDictionary EnglishDictionary `yaml:"english_dictionary,omitempty"`
23-
}
24-
25-
type EnglishDictionary struct {
26-
CommitRef string `yaml:"commit_ref"`
27-
WasCommitRefSet bool
28-
}
29-
3020
type Patterns struct {
3121
AntiEvasion Pattern `yaml:"anti_evasion"`
3222
AntiEvasionSuffix Pattern `yaml:"anti_evasion_suffix"`
@@ -61,13 +51,5 @@ func New(directory string, filename string) *Configuration {
6151
newConfiguration.Patterns.AntiEvasionNoSpaceSuffix.Unix = strings.TrimSpace(newConfiguration.Patterns.AntiEvasionNoSpaceSuffix.Unix)
6252
newConfiguration.Patterns.AntiEvasionNoSpaceSuffix.Windows = strings.TrimSpace(newConfiguration.Patterns.AntiEvasionNoSpaceSuffix.Windows)
6353

64-
if strings.TrimSpace(newConfiguration.Sources.EnglishDictionary.CommitRef) == "" {
65-
newConfiguration.Sources.EnglishDictionary.CommitRef = DefaultDictionaryCommitRef
66-
newConfiguration.Sources.EnglishDictionary.WasCommitRefSet = false
67-
} else {
68-
newConfiguration.Sources.EnglishDictionary.CommitRef = strings.TrimSpace(newConfiguration.Sources.EnglishDictionary.CommitRef)
69-
newConfiguration.Sources.EnglishDictionary.WasCommitRefSet = true
70-
}
71-
7254
return newConfiguration
7355
}

configuration/configuration_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ func (s *configurationTestSuite) TestReadingConfiguration() {
5959

6060
func newTestConfiguration() *Configuration {
6161
return &Configuration{
62-
Sources: Sources{
63-
EnglishDictionary: EnglishDictionary{
64-
CommitRef: "refs/heads/master",
65-
WasCommitRefSet: true,
66-
},
67-
},
6862
Patterns: Patterns{
6963
AntiEvasion: Pattern{
7064
Unix: "_av-u_",

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99

1010
require (
1111
github.com/Masterminds/semver/v3 v3.4.0
12+
github.com/coreruleset/wnram v0.1.0
1213
github.com/creativeprojects/go-selfupdate v1.5.0
1314
github.com/google/uuid v1.6.0
1415
github.com/hashicorp/go-getter/v2 v2.2.3
@@ -40,7 +41,7 @@ require (
4041
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
4142
github.com/pmezard/go-difflib v1.0.0 // indirect
4243
github.com/rogpeppe/go-internal v1.9.0 // indirect
43-
github.com/ulikunitz/xz v0.5.12 // indirect
44+
github.com/ulikunitz/xz v0.5.15 // indirect
4445
github.com/xanzy/go-gitlab v0.115.0 // indirect
4546
golang.org/x/crypto v0.37.0 // indirect
4647
golang.org/x/oauth2 v0.29.0 // indirect
@@ -53,5 +54,5 @@ require (
5354
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5455
github.com/rs/zerolog v1.34.0
5556
github.com/spf13/pflag v1.0.6 // indirect
56-
github.com/stretchr/testify v1.10.0
57+
github.com/stretchr/testify v1.11.0
5758
)

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
code.gitea.io/sdk/gitea v0.21.0 h1:69n6oz6kEVHRo1+APQQyizkhrZrLsTLXey9142pfkD4=
22
code.gitea.io/sdk/gitea v0.21.0/go.mod h1:tnBjVhuKJCn8ibdyyhvUyxrR1Ca2KHEoTWoukNhXQPA=
3-
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
4-
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
53
dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8=
64
dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
75
github.com/42wim/httpsig v1.2.2 h1:ofAYoHUNs/MJOLqQ8hIxeyz2QxOz8qdSVvp3PX/oPgA=
86
github.com/42wim/httpsig v1.2.2/go.mod h1:P/UYo7ytNBFwc+dg35IubuAUIs8zj5zzFIgUCEl55WY=
9-
github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4=
10-
github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
117
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
128
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
139
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas=
1410
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4=
1511
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
12+
github.com/coreruleset/wnram v0.1.0 h1:9tNgUX67h8E1WorbiU9OOlgKUJClYjunjBfb7cXPUas=
13+
github.com/coreruleset/wnram v0.1.0/go.mod h1:EeNpPR2NxOfy4x4yQtEQR+Tenn0Qpqcld+kZAzwc5dc=
1614
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
1715
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
1816
github.com/creativeprojects/go-selfupdate v1.5.0 h1:4zuFafc/qGpymx7umexxth2y2lJXoBR49c3uI0Hr+zU=
@@ -90,10 +88,12 @@ github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
9088
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
9189
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
9290
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
93-
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
94-
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
91+
github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8=
92+
github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
9593
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
9694
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
95+
github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY=
96+
github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
9797
github.com/xanzy/go-gitlab v0.115.0 h1:6DmtItNcVe+At/liXSgfE/DZNZrGfalQmBRmOcJjOn8=
9898
github.com/xanzy/go-gitlab v0.115.0/go.mod h1:5XCDtM7AM6WMKmfDdOiEpyRWUqui2iS9ILfvCZ2gJ5M=
9999
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

0 commit comments

Comments
 (0)