Giter VIP home page Giter VIP logo

Comments (11)

mholiday-nyt avatar mholiday-nyt commented on July 27, 2024 1

PR looks good to me; thanks again, this has been really easy!

from wsl.

bombsimon avatar bombsimon commented on July 27, 2024

Interesting! We had a quite long discussion in #82 about a similar question but that was to group := and var. We moved on to #83 and I ended up adding a flag to allow that. I didn't really consider this option.

I would be open to a PR for the first case, I encourage everyone who wants to use whitespaces! I would however not enforce this by default but as an opt in. The second one is violating the enforcing of cuddle error checks to where the error is defined, I'm not sure how they would work together. Maybe just have the new flag only allowing assignment grouping override any other flag.

What do you thing this kind of configuration would be referenced to and how would it work? ForceExclusiveAssignment maybe and then just having assignments with := having to be separated from everything except other assignments?

from wsl.

mholiday-nyt avatar mholiday-nyt commented on July 27, 2024

Yeah. One thing is that I find it clearer to talk about := as "short declarations" because they're not the same as assignments with =; they actually introduce a new name, which is my whole thought around separating them (even though mentally I still think of := as the Pascal assignment operator)

Yes, it would definitely be opt-in, and yes, it would force these things to be grouped apart

You can see my style in https://github.com/matt4biz/envy for example; I've found over the years that I have about 30% of the total lines as blank lines, even across different languages (well, at least since giving up punch cards ;-)

I particularly like separating declarations into bunches and having spaces around all block constructs; it's all about making the code easier to speed-read

from wsl.

bombsimon avatar bombsimon commented on July 27, 2024

Sounds reasonable to group it that way! I like your code style in general, we seem to have very similar idea.

Feel free to start working on a PR with an opt-in option to enforce shorthand declarations to be cuddled only with other shorthand declarations!

from wsl.

bombsimon avatar bombsimon commented on July 27, 2024

I'll hold of drafting a new release until we decided on #104 as well so we can merge them to golangci-lint at the same time!

from wsl.

bombsimon avatar bombsimon commented on July 27, 2024

Both PRs merged and I created v3.3.0 so it should be easy to update golangci-lint. If you want me to do it I can do it tomorrow!

Thanks for your issues and PRs, really appreciated!

from wsl.

matt4biz avatar matt4biz commented on July 27, 2024

😎

from wsl.

mholiday-nyt avatar mholiday-nyt commented on July 27, 2024

Ahh, having looked at your last merge to golangci-lint, I see it's a bit more than just updating a version

LMK if you'd like me to help / review the PR

from wsl.

bombsimon avatar bombsimon commented on July 27, 2024

I'll create a PR later today and let you know when it's ready!

from wsl.

bombsimon avatar bombsimon commented on July 27, 2024

Filed golangci/golangci-lint#1922

from wsl.

bombsimon avatar bombsimon commented on July 27, 2024

Merged!

from wsl.

Related Issues (20)

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.