Commit Graph

11 Commits

Author SHA1 Message Date
Spencer Schrock
0b9dfb656f
⚠️ Replace v4 module references with v5 (#4027)
Signed-off-by: Spencer Schrock <sschrock@google.com>
2024-04-12 14:51:50 -07:00
dependabot[bot]
bf18c27508
🌱 Bump github.com/golangci/golangci-lint from 1.56.2 to 1.57.1 in /tools (#3966)
* 🌱 Bump github.com/golangci/golangci-lint in /tools

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.56.2 to 1.57.1.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.56.2...v1.57.1)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* remove unused wrapcheck nolint directives

wrapcheck v2.8.3 includes a fix for false positives in func literals.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* satisfy assignOp gocritic linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

* convert const regex to MustCompile

included at package level to ensure regex compiles at build time.
These could stay as func regexes if desired, but we'd need test coverage
for the piper code so we know we wont panic

Signed-off-by: Spencer Schrock <sschrock@google.com>

* satisfy unslice linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

* satisfy wrapperFunc linter

This seems like a nice readability change anyway

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Spencer Schrock <sschrock@google.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Spencer Schrock <sschrock@google.com>
2024-03-25 15:56:22 -07:00
Spencer Schrock
d55dbd12e6
⚠️ Switch RepoClient file access to io.ReadCloser (#3912)
* change file access method to io.ReadCloser

callers don't always need the full file.
large files are slow and can cause crashes.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* switch tests to hardcoded readers

Previously they returned bytes or strings, which have corresponding NewReader types.
Since they don't need to be closed, io.NopCloser works well to give them a fake Close.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* switch tests which called os.ReadFile to os.Open

os.File fufills io.ReadCloser, so this is an easy change

Signed-off-by: Spencer Schrock <sschrock@google.com>

* break tarball tests into two steps: reader and read

The rest of the test was kept the same to minimize the change.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* ossfuzz doesn't implement GetFileReader

Signed-off-by: Spencer Schrock <sschrock@google.com>

* appease linter during refactor

Signed-off-by: Spencer Schrock <sschrock@google.com>

* switch git client to new method

add check which ensures git client fulfills the interface

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2024-03-04 17:37:50 -08:00
dependabot[bot]
b31449017e
🌱 Bump github.com/golangci/golangci-lint from 1.55.2 to 1.56.1 in /tools (#3867)
* 🌱 Bump github.com/golangci/golangci-lint in /tools

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.55.2 to 1.56.1.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.55.2...v1.56.1)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* autofix linter errors with make fix-linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

* move musttag nolint directives to encode location

this was changed in v0.8.0 of the musttag linter.

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Spencer Schrock <sschrock@google.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Spencer Schrock <sschrock@google.com>
2024-02-09 10:53:24 -08:00
Naveen
a4148d9f17
🌱 Included additional method to git client (#3761)
* 🌱 Included additional method to git client

- Included additional methods to satisfy the local git client

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>

* Code review comments.

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>

* Fixed the incorrect gitlab test config.

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>

* Fixed code review comments.

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2024-01-07 17:53:58 +00:00
Spencer Schrock
d882fc73e1
🌱 re-enable paralleltest linter (#3705)
Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-12-04 02:25:03 +00:00
Spencer Schrock
1625b0c578
🌱 Disable more style linters for test files (#3707)
* disable lll linter for test files
* disable goerr113 linter for tests
* disable wrapcheck linter for tests
* fix easy linter issues in tests

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-12-04 02:14:01 +00:00
Spencer Schrock
92470deac3
🌱 enable nolintlint linter and fix violations (#3650)
* enable nolintlint

Signed-off-by: Spencer Schrock <sschrock@google.com>

* first chunk of fixing nolintlint

Signed-off-by: Spencer Schrock <sschrock@google.com>

* second chunk of fixing nolintlint

Signed-off-by: Spencer Schrock <sschrock@google.com>

* third chunk of fixing nolintlint

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fourth chunk of fixing nolintlint

Signed-off-by: Spencer Schrock <sschrock@google.com>

* include reason for the specific linter config

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fifth chunk of fixing nolintlint

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fix linter errors that are somehow still triggering

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-11-15 11:44:28 -08:00
Spencer Schrock
93875dd11c
🐛 Fix loop aliasing errors causing linter to fail. (#3414)
Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-08-22 17:48:21 -07:00
Naveen
accaffdfe2
🌱 Unit tests for git client (#3328)
- Add test functions to the Git client for testing repository initialization, commit listing, and search functionality

[clients/git/client_test.go]
- Add `createTestRepo` function to set up a test repository
- Add `TestInitRepo` to test the initialization of a repository
- Add `TestListCommits` to test the listing of commits
- Add `TestSearch` to test the search functionality

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-08-15 17:20:38 +00:00
Azeem Shaikh
8966abdceb
Initial implementation of go-git client (#2720)
Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com>
2023-03-15 21:28:09 +00:00