GithubHelp home page GithubHelp logo

gofmt about ci-helpers HOT 10 CLOSED

ipfs avatar ipfs commented on June 16, 2024 1
gofmt

from ci-helpers.

Comments (10)

kevina avatar kevina commented on June 16, 2024 1

Yeah I think something like

GITDIR="$(pwd)"
cd "$(mktemp -d)"
git checkout --git-dir="$GITDIR"/.git
go fmt ./...

will work

from ci-helpers.

kevina avatar kevina commented on June 16, 2024

How about find . -name '*.go' -print0 | xargs -0 gofmt -l so that we don't actually modify any files.

Is there some code go code we should avoid running the gofmt check on?

from ci-helpers.

Kubuxu avatar Kubuxu commented on June 16, 2024

In go-ipfs we run go fmt over all code but we might want to exclude /vendor/ for "reasons".

from ci-helpers.

Stebalien avatar Stebalien commented on June 16, 2024

How about find . -name '*.go' -print0 | xargs -0 gofmt -l so that we don't actually modify any files.

SGTM.

Is there some code go code we should avoid running the gofmt check on?

Not that I can think of. However, we may run into issues with gx-go rw and gofmt. I'm not sure.

from ci-helpers.

Kubuxu avatar Kubuxu commented on June 16, 2024

Afaik, gx-go might format code, it runs the code through AST which when outputting formats it (I think).

from ci-helpers.

Stebalien avatar Stebalien commented on June 16, 2024

Hm. Do we need to run this pre-install?

from ci-helpers.

kevina avatar kevina commented on June 16, 2024

I don't like the idea of having to do this pre-install and not in the test script.

We could check out a clean copy in a tmpdir and run go fmt there...

from ci-helpers.

Stebalien avatar Stebalien commented on June 16, 2024

I don't like the idea of having to do this pre-install and not in the test script.

I agree.

We could check out a clean copy in a tmpdir and run

Yuck but..., yes? I can't think of a better solution (it would also help us avoid any other contamination).

from ci-helpers.

Stebalien avatar Stebalien commented on June 16, 2024

SGTM.

from ci-helpers.

kevina avatar kevina commented on June 16, 2024

This is now done, but I had to use git clone -s.

from ci-helpers.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.