Skip to content

Commit

Permalink
Updated dependencies (#769)
Browse files Browse the repository at this point in the history
* Updated dependencies

* Dropped pre-generics versions of Go

* Updated ANTRL

* Added staticcheck and goimports tools

* Updated build steps

* Fixed unit tests for http funcs
  • Loading branch information
ziflex authored Feb 7, 2023
1 parent dd33141 commit d201b50
Show file tree
Hide file tree
Showing 273 changed files with 2,986 additions and 1,675 deletions.
47 changes: 30 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,54 @@ name: build
on: [push, pull_request]

jobs:
analyze:
name: Static Analysis
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.19'

- name: Set up linters
run: make install-tools

- name: Lint
run: |
make vet
make lint
make fmt
git diff
if [[ $(git diff) != '' ]]; then echo 'Invalid formatting!' >&2; exit 1; fi
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
goVer: [1.14, 1.15, 1.16, 1.17]
goVer: [1.18, 1.19]
steps:
- name: Set up Go ${{ matrix.goVer }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.goVer }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Set up ANTLR
env:
ANTLR_VERSION: 4.9
ANTLR_VERSION: 4.11.1
run: |
sudo curl -o /usr/local/lib/antlr-${ANTLR_VERSION}-complete.jar https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar
export CLASSPATH=".:/usr/local/lib/antlr-${ANTLR_VERSION}-complete.jar:$CLASSPATH"
mkdir $HOME/antlr-bin
echo -e '#!/bin/bash\njava -jar /usr/local/lib/antlr-4.9-complete.jar "$@"' > $HOME/antlr-bin/antlr
echo -e '#!/bin/bash\njava -jar /usr/local/lib/antlr-4.11.1-complete.jar "$@"' > $HOME/antlr-bin/antlr
echo -e '#!/bin/bash\njava org.antlr.v4.gui.TestRig "$@"' > $HOME/antlr-bin/grun
chmod +x $HOME/antlr-bin/*
export PATH=$PATH:$HOME/antlr-bin
Expand All @@ -34,23 +61,9 @@ jobs:
curl https://github.com/MontFerret/lab/master/install.sh -o install.sh
sudo sh install.sh
- name: Set up linters
run: go install github.com/mgechev/revive@latest

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: make install

- name: Lint
run: |
make vet
make lint
make fmt
git diff
if [[ $(git diff) != '' ]]; then echo 'Invalid formatting!' >&2; exit 1; fi
- name: Generate
run: |
export PATH=$PATH:$HOME/antlr-bin
Expand Down
52 changes: 25 additions & 27 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '44 5 * * 4'

jobs:
analyze:
Expand All @@ -34,34 +32,34 @@ jobs:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ default: build

build: vet generate test compile

install-tools:
go install honnef.co/go/tools/cmd/staticcheck@latest && \
go install golang.org/x/tools/cmd/goimports@latest && \
go install github.com/mgechev/revive@latest

install:
go get

Expand Down Expand Up @@ -37,11 +42,13 @@ doc:

# http://golang.org/cmd/go/#hdr-Run_gofmt_on_package_sources
fmt:
go fmt ${DIR_PKG}/...
go fmt ${DIR_PKG}/... && \
goimports -w -local github.com/MontFerret ./pkg ./e2e

# https://github.com/mgechev/revive
# go get github.com/mgechev/revive
lint:
staticcheck ./pkg/compiler ./pkg/drivers ./pkg/runtime ./pkg/stdlib && \
revive -config revive.toml -formatter stylish -exclude ./pkg/parser/fql/... -exclude ./vendor/... ./...

# http://godoc.org/code.google.com/p/go.tools/cmd/vet
Expand Down
3 changes: 2 additions & 1 deletion e2e/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"os/signal"
Expand Down Expand Up @@ -259,7 +260,7 @@ func main() {
// check whether the app is getting a query via standard input
std := bufio.NewReader(os.Stdin)

b, err := ioutil.ReadAll(std)
b, err := io.ReadAll(std)

if err != nil {
fmt.Println(err)
Expand Down
26 changes: 14 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
module github.com/MontFerret/ferret

go 1.17
go 1.18

require (
github.com/PuerkitoBio/goquery v1.8.0
github.com/antchfx/htmlquery v1.2.5
github.com/antchfx/xpath v1.2.1
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20211211185417-43fb4c2dbe28
github.com/antchfx/htmlquery v1.3.0
github.com/antchfx/xpath v1.2.3
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20221202181307-76fa05c21b12
github.com/corpix/uarand v0.2.0
github.com/gobwas/glob v0.2.3
github.com/gorilla/css v1.0.0
github.com/jarcoal/httpmock v1.2.0
github.com/jarcoal/httpmock v1.3.0
github.com/mafredri/cdp v0.33.0
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.28.0
github.com/sethgrid/pester v1.1.0
github.com/rs/zerolog v1.29.0
github.com/sethgrid/pester v1.2.0
github.com/smartystreets/goconvey v1.7.2
github.com/stretchr/testify v1.8.1
github.com/wI2L/jettison v0.7.4
golang.org/x/net v0.0.0-20211209124913-491a49abca63
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/text v0.4.0
golang.org/x/net v0.5.0
golang.org/x/sync v0.1.0
golang.org/x/text v0.6.0
)

require (
github.com/andybalholm/cascadia v1.3.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
Expand All @@ -35,6 +36,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/smartystreets/assertions v1.2.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/sys v0.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit d201b50

Please sign in to comment.