Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devie #44

Merged
merged 27 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bca8da2
made model generator alphabetical
conneroisu Sep 12, 2024
e8983eb
remove commented out example
conneroisu Sep 13, 2024
a3806c9
move tests to the test folder and move txt to tmpl file
conneroisu Sep 13, 2024
232cc3d
did some cleaning and added another example
conneroisu Sep 13, 2024
83c0ead
run fmt
conneroisu Sep 13, 2024
80443ad
added moderation example
conneroisu Sep 13, 2024
439c18a
remove do files
conneroisu Sep 14, 2024
01912ed
refactor: clean up code and improve formatting in main.go and moderat…
conneroisu Sep 14, 2024
2b8c870
latest
conneroisu Sep 14, 2024
bd517f4
added moderation test
conneroisu Sep 14, 2024
20b9f01
aded modules needed for new vhdl example
conneroisu Sep 14, 2024
d68eb9e
move tests back to root
conneroisu Sep 14, 2024
09bcc0c
add back test for commas
conneroisu Sep 14, 2024
7392694
added package documentation to the examples
conneroisu Sep 14, 2024
b1f9e0a
added tests back
conneroisu Sep 14, 2024
e93768d
added and fixed tests from before
conneroisu Sep 14, 2024
06cfaab
update workspace
conneroisu Sep 14, 2024
1b883f3
remove golines from fmt.sh as it breaks some tests
conneroisu Sep 14, 2024
cccbb88
remove sqlc from the workflow
conneroisu Sep 14, 2024
fb3b714
added test build headers to files that were missing them
conneroisu Sep 14, 2024
5ba2bc2
added test build tags to unit tests
conneroisu Sep 14, 2024
ee555ac
added tests to internal testsing package
conneroisu Sep 14, 2024
152a977
remove test build tags from unit tests
conneroisu Sep 14, 2024
42c98ad
upgrade go version used in workfows
conneroisu Sep 14, 2024
d3b67ac
set to latest golangci-lint
conneroisu Sep 14, 2024
8959556
latest
conneroisu Sep 15, 2024
8ccc359
added revive to golagnci config and workflow
conneroisu Sep 15, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/chron-models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
go-version: '1.23.1'

# Step 3: Run go mod download
- name: Run go mod download
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,14 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23.1'
cache: true
- name: Install requirements
id: install-lint-requirements
run: |
go mod download
go install github.com/golangci/golangci-lint/cmd/[email protected]
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- name: Lint
id: lint
run: |
golangci-lint run
- name: Vet
id: vet
run: |
sqlc vet
go vet ./...
- name: Run Revive Action by pulling pre-built image
uses: docker://morphy/revive-action:v2
with:
config: .revive.toml
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.23'
go-version: '1.23.1'
- name: Check out code
uses: actions/checkout@v3
- name: Install dependencies
Expand Down
22 changes: 22 additions & 0 deletions .golangci.reference.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Options for analysis running.
run:
# See the dedicated "run" documentation section.
option: value
# output configuration options
output:
# See the dedicated "output" documentation section.
option: value
# All available settings of specific linters.
linters-settings:
# See the dedicated "linters-settings" documentation section.
option: value
linters:
# See the dedicated "linters" documentation section.
option: value
issues:
# See the dedicated "issues" documentation section.
option: value
severity:
# See the dedicated "severity" documentation section.
option: value
14 changes: 14 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
linters-settings:
revive:
ignore-generated-header: true
severity: warning
rules:
- name: atomic
- name: line-length-limit
severity: error
arguments: [80]
- name: unhandled-error
arguments : ["fmt.Printf", "myFunction"]

linters:
disable-all: false
5 changes: 4 additions & 1 deletion audio_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package groq //nolint:testpackage // testing private field
//go:build !test
// +build !test

package groq

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion builders_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build !test
// +build !test

package groq // testing private field
package groq

import (
"bytes"
Expand Down Expand Up @@ -69,17 +69,17 @@
}

// TestFormBuilderWithFailingWriter tests the form builder returns an error when the writer fails.
func TestFormBuilderWithFailingWriter(t *testing.T) {
a := assert.New(t)
dir, cleanup := test.CreateTestDirectory(t)
defer cleanup()
file, err := os.CreateTemp(dir, "")
if err != nil {
t.Errorf("Error creating tmp file: %v", err)
}
defer file.Close()
defer os.Remove(file.Name())

Check warning on line 82 in builders_test.go

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 10 lines is too similar to builders_test.go:93
builder := newFormBuilder(&failingWriter{})
err = builder.CreateFormFile("file", file)
a.ErrorIs(
Expand All @@ -90,17 +90,17 @@
}

// TestFormBuilderWithClosedFile tests the form builder returns an error when the file is closed.
func TestFormBuilderWithClosedFile(t *testing.T) {
a := assert.New(t)
dir, cleanup := test.CreateTestDirectory(t)
defer cleanup()

file, err := os.CreateTemp(dir, "")
if err != nil {
t.Errorf("Error creating tmp file: %v", err)
}
file.Close()
defer os.Remove(file.Name())

Check warning on line 103 in builders_test.go

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 10 lines is too similar to builders_test.go:72

body := &bytes.Buffer{}
builder := newFormBuilder(body)
Expand Down
Loading
Loading