This package is not in the latest version of its module.
WSL - Whitespace Linter
WSL is a linter that enforces a very non scientific vision of how to make code more readable by enforcing empty lines at the right places.
I think too much code out there is to cuddly and a bit too warm for it's own good, making it harder for other people to read and understand. The linter will warn about newlines in and around blocks, in the beginning of files and other places in the code.
I know this linter is aggressive and a lot of projects I've tested it on have failed miserably. For this linter to be useful at all I want to be open to new ideas, configurations and discussions! Also note that some of the warnings might be bugs or unintentional false positives so I would love an issue to fix, discuss, change or make something configurable!
Installation
By go get (local installation).
You can do that by using:
By golangci-lint (CI automation)
wsl is already integrated with golangci-lint . Please refer to the instructions there.
How to use depends on how you install wsl .
With local binary
The general command format for wsl is:
The "..." wildcard is not used like other go commands but instead can only be to a relative or absolute path.
By default, the linter will run on ./... which means all go files in the current path and all subsequent paths, including test files. To disable linting test files, use -n or --no-test .
The recommended command is:
For more information, please refer to golangci-lint 's documentation.
Issues and configuration
The linter suppers a few ways to configure it to satisfy more than one kind of code style. These settings could be set either with flags or with YAML configuration if used via golangci-lint .
The supported configuration can be found in the documentation .
Below are the available checklist for any hit from wsl . If you do not see any, feel free to raise an issue .
Note : this linter doesn't take in consideration the issues that will be fixed with go fmt -s so ensure that the code is properly formatted before use.
- Anonymous switch statements should never be cuddled
- Append only allowed to cuddle with appended value
- Assignments should only be cuddled with other assignments
- Block should not end with a whitespace (or comment)
- Block should not start with a whitespace
- Case block should end with newline at this size
- Branch statements should not be cuddled if block has more than two lines
- Declarations should never be cuddled
- Defer statements should only be cuddled with expressions on same variable
- Expressions should not be cuddled with blocks
- Expressions should not be cuddled with declarations or returns
- For statement without condition should never be cuddled
- For statements should only be cuddled with assignments used in the iteration
- Go statements can only invoke functions assigned on line above
- If statements should only be cuddled with assignments
- If statements should only be cuddled with assignments used in the if statement itself
- If statements that check an error must be cuddled with the statement that assigned the error
- Only cuddled expressions if assigning variable or using from line above
- Only one cuddle assignment allowed before defer statement
- Only one cuddle assginment allowed before for statement
- Only one cuddle assignment allowed before go statement
- Only one cuddle assignment allowed before if statement
- Only one cuddle assignment allowed before range statement
- Only one cuddle assignment allowed before switch statement
- Only one cuddle assignment allowed before type switch statement
- Ranges should only be cuddled with assignments used in the iteration
- Return statements should not be cuddled if block has more than two lines
- Short declarations should cuddle only with other short declarations
- Switch statements should only be cuddled with variables switched
- Type switch statements should only be cuddled with variables switched
Documentation ¶
- type Configuration
- func DefaultConfig() Configuration
- type Processor
- func NewProcessor() *Processor
- func NewProcessorWithConfig(cfg Configuration) *Processor
- func (p *Processor) ProcessFiles(filenames []string) ([]Result, []string)
- type Result
- func (r *Result) String() string
Constants ¶
This section is empty.
Variables ¶
Functions ¶, type configuration ¶, func defaultconfig ¶.
DefaultConfig returns default configuration.
type Processor ¶
Func newprocessor ¶.
NewProcessor will create a Processor.
func NewProcessorWithConfig ¶
Func (*processor) processfiles ¶.
ProcessFiles takes a string slice with file names (full paths) and lints them.
type Result ¶
Result represents the result of one error.
func (*Result) String ¶
String returns the filename, line number and reason of a Result.
Source Files ¶
Directories ¶, keyboard shortcuts.
Assignments should only be cuddled with other assignments
Assignments should only be cuddled with other assignments pdf,doc ,images, [pdf] untitled.
When the subject of the sentence is complex the following verb must agree with nouns that are only used in the plural or have a different meaning in ... AGU et corriges
[PDF] FACTS EVERY BUNNY PARENT (or parent-to-be) SHOULD KNOW
If you have other pets or small children or when you first bring bunny home 24 hours a day BUNNY INFO HANDOUT
[PDF] My two cats
Listen to Dave talking about travelling to different countries with his cats. 2. …… to cuddle ... 8. very happy seem just to be They being in the flat. LearnEnglish Audio zone My two cats
[PDF] The Influence of Cuddling on Relational Health for Cohabitating
that cuddling is only engaged in with close relationships in which one feels Another way hugging and cuddling could be differentiated is through the. vanRaalte asu E
[PDF] Postpartum care of the mother and newborn
2 févr. 2011 Other common postpartum complications include urinary tract ... In institutions babies should be kept with their mother and unrestricted. WHO RHT MSM .
[PDF] Getting to the Core
8 oct. 2011 Lesson 2: How do different people handle inequality and what does ... to students that they should only focus on writing down their initial. th Road to Equality Unit.Final
[PDF] The Gift of Hospitality: - Opening the Doors of Community Life to
him until most people could only see the problem GOH MOC
[PDF] Building Baby's Intelligence: Why Infant Stimulation Is So Important
network building capacity happens only once in a life- Gently hold cuddle and rock an ... Let the infant experience different surroundings by. buildbabyinten adr
[PDF] Infancy.pdf
cuddling the infant. Anticipatory guidance should include information on the vulnerability of infants to infectious disease sudden infant death syndrome Infancy
[PDF] Structured Training Module: Leadership Team Building and
have reposed upon us in asking us to handle this assignment. Day V (Afternoon) Ethical Leadership and Other Emerging Issues……...239. C STMLeadershipandTeamBuilding
[PPT],[Doc] Assignments should only be cuddled with other assignments
- assignments should only be cuddled with other assignments golang
IMAGES
COMMENTS
Assignments should only be cuddled with other assignments. Can be configured, see configuration documentation. Assignments should either be grouped together or have some space between whoever else before it. One bad example is z and y in such case: if x == 1 { x = 0} z:= x + 2 fmt.
Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience. To learn more, see our tips on writing great answers .
Only one cuddle assignment allowed before type switch statement; Ranges should only be cuddled with assignments used in the iteration; Return statements should not be cuddled if block has more than two lines; Short declarations should cuddle only with other short declarations; Switch statements should only be cuddled with variables switched ...
False-positive "if statements should only be cuddled with assignments used in the if statement itself" #26. Closed zx8 opened this issue Oct 8, 2019 · 1 comment · Fixed by #27. Closed False-positive "if statements should only be cuddled with assignments used in the if statement itself" #26.
Only one cuddle assignment allowed before range statement; Only one cuddle assignment allowed before switch statement; Only one cuddle assignment allowed before type switch statement; Ranges should only be cuddled with assignments used in the iteration; Return statements should not be cuddled if block has more than two lines; Short declarations ...
Assignments should only be cuddled with other assignments Untitled When the subject of the sentence is complex the following verb must agree with nouns that are only used in the plural or have a different meaning in ...
A good linter should not (in my opinion) require a customized configuration. So I think about how to keep wsl simple (smart but with simple and understandable rules). So I would say the rule "for statements should only be cuddled with assignments used in the iteration" applies to the whole for block including all nested blocks. This is a simple ...
Instructions for writing the Assignments 3 and 4: a. All the assignment questions and answers should be handwritten (neatly) b. You are required to use A4 size white papers only for writing (using any other pages or papers will lead to rejection) c. Maintain neatness with clear writing d. The front page of the assignment should have Student IDs; Name; Signatures in front of the names; Date of ...
$ wsl xxx/yyy/zzz_v1.go:64: ranges should only be cuddled with assignments used in the iteration $ wsl --fix flag provided but not defined: -fix Usage of wsl: -allow-assign-and-call Allow assignments and calls to be cuddled (if using same variable/type) (default true) -allow-cuddle-declarations Allow declarations to be cuddled -allow-multi-line-assign Allow cuddling with multi line assignments ...
Assignments should only be cuddled with other assignments PDF,Doc ,Images [PDF] Untitled. When the subject of the sentence is complex the following verb must agree with nouns that are only used in the plural or have a different meaning in ... AGU et corriges