Comments (11)
PR looks good to me; thanks again, this has been really easy!
from wsl.
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.
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.
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.
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.
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.
😎
from wsl.
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.
I'll create a PR later today and let you know when it's ready!
from wsl.
Filed golangci/golangci-lint#1922
from wsl.
Merged!
from wsl.
Related Issues (20)
- go routine support wait group on previous line HOT 6
- AllowSeparatedLeadingComment doesn't allow one comment + WS before first statement HOT 2
- False-negative cuddled assignment line above HOT 3
- Require new lines after multiline function signature HOT 1
- Drop overlapping support for v4 HOT 4
- allow go statements invoke inline function HOT 4
- Read closing bracket(s) as empty lines HOT 4
- [Docs] `force-err-cuddling` is referenced as `enforce-err-cuddling` in the documentation HOT 2
- Comment in default block should not be seen as trailing comment HOT 1
- Incorrect check of assignment usage in loop and if statements HOT 1
- `++`/`--` should be treated as an assignment HOT 1
- Group `DeclStmt` instead of splitting with empty lines
- Error installing: does not contain packages matching github.com/bombsimon/wsl/v4/cmd/... HOT 5
- `else`/`else if` blocks are not processed
- Install instructions don't work (for me) HOT 1
- `--fix` ? HOT 2
- Issue with accessing functions and variables across files within the same package in v4 HOT 2
- Consider `i++` as an assignment used in the iteration HOT 5
- Passed literal anonymous function to function is not checked. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wsl.