-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove newlines at start and end of methods #4670
Conversation
Did you use a script for that? I kind of liked the have it at the beginning but good to unify. |
filebeat/fileset/fileset.go
Outdated
@@ -37,7 +37,6 @@ func New( | |||
name string, | |||
mcfg *ModuleConfig, | |||
fcfg *FilesetConfig) (*Fileset, error) { | |||
|
|||
modulePath := filepath.Join(modulesPath, mcfg.Module) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's cases like this one when a blank line helps readability? Otherwise, there's no indentation hint between the function header and the block, making it hard to read, IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, was thinking the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I think in cases where the function declaration spans multiple lines I will leave those blank lines alone. Will update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the PR and it with from 210 files modified (485 deletions) to 198 files modified (438 deletions).
42f9cfc
to
087917f
Compare
Argh, all green, but now there's a conflict. |
I am adding an empty line after the function definition, especially when the function has many arguments. If the others find it better to have no empty line, I can adjust my habits. |
This removes blank lines from the start and end of functions. For example, this function func foo() { return bar } would become func foo() { return bar } This tightens up the code and allows you to see more context when viewing the source code.
087917f
to
c2b01cd
Compare
This removes blank lines from the start and end of functions. For example, this function
would become
This tightens up the code and allows you to see more context when viewing
the source code.