Skip to content

Commit

Permalink
fix: Remove dump checkout and remove pre-commit (#982)
Browse files Browse the repository at this point in the history
* fix: Remove dump checkout

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

* fix: Remove pre-commit

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

* fix: Update

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

* fix: Update

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

* fix: Update

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

* fix: Update

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

* fix: Update

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

* fix: Update

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

Signed-off-by: Ce Gao <cegao@tensorchord.ai>
  • Loading branch information
gaocegege authored Oct 8, 2022
1 parent f4ebb02 commit 0be9969
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 18 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,16 @@ jobs:
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.0
- run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: Add license
run: |
make addlicense && git add pkg cmd &&
git diff --cached --exit-code || (echo 'Please run "make addlicense" to verify govet' && exit 1);
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11.0-beta.3'
env:
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache
RUNNER_TOOL_CACHE: /opt/hostedtoolcache
- id: file_changes
uses: trilom/file-changes-action@v1.2.4
with:
output: ' '
- uses: pre-commit/action@v3.0.0
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
extra_args: --files ${{ steps.file_changes.outputs.files}}
version: latest
# Ref https://github.com/golangci/golangci-lint-action/issues/244
skip-pkg-cache: true
test:
name: test
strategy:
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ linters:
- govet
- ineffassign
- misspell
- noloopclosure
- rowserrcheck
- sqlclosecheck
- staticcheck
Expand Down
3 changes: 2 additions & 1 deletion pkg/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ func (b generalBuilder) addBuilderTag(labels *map[string]string) {
(*labels)[types.ImageLabelCacheHash] = b.manifestCodeHash
}

// nolint:unparam
func (b generalBuilder) imageConfig(ctx context.Context) (string, error) {
labels, err := ir.Labels()
if err != nil {
Expand Down Expand Up @@ -379,7 +380,7 @@ func (b generalBuilder) checkIfNeedBuild(ctx context.Context) bool {
return true
}

// Always return updated when met error
// nolint:unparam
func (b generalBuilder) checkDepsFileUpdate(ctx context.Context, tag string, manifest string, deps []string) (bool, error) {
dockerClient, err := docker.NewClient(ctx)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/builder/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package builder

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/editor/vscode/vscode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package vscode

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/lang/ir/conda.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ func (g Graph) compileCondaEnvironment(root llb.State) (llb.State, error) {
return run.Root(), nil
}

// nolint:unparam
func (g Graph) installConda(root llb.State) (llb.State, error) {
if g.CondaConfig.UseMicroMamba {
run := root.AddEnv("MAMBA_BIN_DIR", condaBinDir).
Expand Down
1 change: 1 addition & 0 deletions pkg/lang/ir/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/moby/buildkit/client/llb"
)

// nolint:unparam
func (g Graph) compileCustomPython(aptStage llb.State) (llb.State, error) {
pypiMirrorStage := g.compilePyPIIndex(aptStage)

Expand Down
1 change: 1 addition & 0 deletions pkg/lang/ir/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func (g Graph) generateJupyterCommand(workingDir string) []string {
return cmd
}

// nolint:unparam
func (g Graph) generateRStudioCommand(workingDir string) []string {
if g.RStudioServerConfig == nil {
return nil
Expand Down
1 change: 1 addition & 0 deletions pkg/lang/ir/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package ir

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/lang/ir/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func (g Graph) compileSystemPackages(root llb.State) llb.State {
return run.Root()
}

// nolint:unparam
func (g *Graph) compileExtraSource(root llb.State) (llb.State, error) {
if len(g.HTTP) == 0 {
return root, nil
Expand Down
5 changes: 4 additions & 1 deletion pkg/metrics/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package metrics

import "math"
import (
"math"
)

func round(num float64) int {
return int(num + math.Copysign(0.5, num))
Expand Down
1 change: 1 addition & 0 deletions pkg/progress/progressui/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ type vertex struct {
hidden bool
}

// nolint:unparam
func (v *vertex) update(c int) {
if v.count == 0 {
now := time.Now()
Expand Down
1 change: 1 addition & 0 deletions pkg/remote/sshd/sshd.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (srv *Server) ListenAndServe() error {
return server.ListenAndServe()
}

//nolint:unparam
func (srv *Server) getServer() (*ssh.Server, error) {
forwardHandler := &ssh.ForwardedTCPHandler{}

Expand Down
1 change: 1 addition & 0 deletions pkg/ssh/config/ssh_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func (h *host) String() string {

}

// nolint:unparam
func newParam(keyword string, args, comments []string) *param {
return &param{
comments: comments,
Expand Down

0 comments on commit 0be9969

Please sign in to comment.