sebastien-rosset
Repos
18
Followers
5

Events

create tag
sebastien-rosset create tag v0.0.6-alpha
Created at 2 days ago

remove test that depends on capture

Created at 2 days ago
create tag
sebastien-rosset create tag v0.0.5-alpha
Created at 3 days ago

remove capture of stdout

Created at 3 days ago
create tag
sebastien-rosset create tag v0.0.4-alpha
Created at 5 days ago
create tag
sebastien-rosset create tag v0.0.3-alpha
Created at 5 days ago

remove noop code

Created at 5 days ago
create tag
sebastien-rosset create tag v0.0.2-alpha
Created at 5 days ago

add noop code

Created at 5 days ago
create tag
sebastien-rosset create tag v0.0.1-alpha
Created at 5 days ago

function to add word and custom dictionary

Created at 6 days ago

function to add word and custom dictionary

Created at 6 days ago

function to add word and custom dictionary

Created at 6 days ago

add makefile

add makefile

Created at 6 days ago
pull request reopened
Add better documentation for goimport local-prefixes

Change in this PR

Improve the documentation of the goimports linter.

Problem Statement

The existing local-prefixes attribute of the goimports linter does not explain what happens if the attribute is set.

The existing summary of the goimports linter is:

In addition to fixing imports, goimports also formats your code in the same style as gofmt.

linters-settings:
  goimports:
    # Put imports beginning with prefix after 3rd-party packages.
    # It's a comma-separated list of prefixes.
    # Default: ""
    local-prefixes: github.com/org/project
Created at 1 week ago
pull request closed
Add better documentation for goimport local-prefixes

Change in this PR

Improve the documentation of the goimports linter.

Problem Statement

The existing local-prefixes attribute of the goimports linter does not explain what happens if the attribute is set.

The existing summary of the goimports linter is:

In addition to fixing imports, goimports also formats your code in the same style as gofmt.

linters-settings:
  goimports:
    # Put imports beginning with prefix after 3rd-party packages.
    # It's a comma-separated list of prefixes.
    # Default: ""
    local-prefixes: github.com/org/project
Created at 1 week ago
issue comment
nolint by linter rule

For the gocritic example, there are three possible levels: gocritic:ruleguard:ruleguard-rule-name. Ruleguard is a powerful checker under gocritic, and within ruleguard it's possible to have hundreds of checks.

Created at 1 week ago
issue comment
Add better documentation for goimport local-prefixes

you can use gci

I could add a reference to cgi from the goimports linter:

See cgi for a more opinionated go import linter.

Created at 1 week ago
issue comment
Add better documentation for goimport local-prefixes

There is a CI deployment issue due to Ubuntu 16.04.

UNSUPPORTED BUILD IMAGE The build image for this site uses Ubuntu 16.04 Xenial Xerus, which is no longer supported.

Created at 1 week ago
pull request reopened
Add better documentation for goimport local-prefixes

Change in this PR

Improve the documentation of the goimports linter.

Problem Statement

The existing local-prefixes attribute of the goimports linter does not explain what happens if the attribute is set.

The existing summary of the goimports linter is:

In addition to fixing imports, goimports also formats your code in the same style as gofmt.

linters-settings:
  goimports:
    # Put imports beginning with prefix after 3rd-party packages.
    # It's a comma-separated list of prefixes.
    # Default: ""
    local-prefixes: github.com/org/project
Created at 1 week ago
pull request closed
Add better documentation for goimport local-prefixes

Change in this PR

Improve the documentation of the goimports linter.

Problem Statement

The existing local-prefixes attribute of the goimports linter does not explain what happens if the attribute is set.

The existing summary of the goimports linter is:

In addition to fixing imports, goimports also formats your code in the same style as gofmt.

linters-settings:
  goimports:
    # Put imports beginning with prefix after 3rd-party packages.
    # It's a comma-separated list of prefixes.
    # Default: ""
    local-prefixes: github.com/org/project
Created at 1 week ago
opened issue
Enhance `goimports` linter to support opinionated go import statements

Your feature request related to a problem? Please describe.

This is a proposal to enhance the goimports linter with opinionated go import formatting rules. The linter could:

  1. Validate that go import statements are formatted according to the rules listed in https://github.com/golang/go/issues/20818.
  2. In autofix mode, reformat the go import statements according to the opinionated rules.

Issue 20818 is still in ideation stage, but there is already a concrete implementation: https://github.com/rinchsan/gosimports is effectively a drop-in replacement for the goimport command, with additional opinionated rules to format go import statements.

Describe the solution you'd like.

I can see two options:

  1. Introduce a new gosimport linter that uses gosimport instead of goimport.
  2. Add a new config attribute to the existing goimports linter. The setting would be used to control which command to use, e.g. goimport or gosimport.

Option 2 seems to be better for consumers of the golangci-lint tool. There is one linter to control go import formatting rules, one place to document what the formatting rules are. Also, it seems fairly straightforward to modify https://github.com/golangci/gofmt/tree/master/goimports to support either gosimport or goimport.

Describe alternatives you've considered.

This is a new feature. I'm not aware of the ability to control which go import formatting tool can be used.

Additional context.

Assuming the -local argument is the same for goimport and gosimport:

  1. The gosimport command may reformat code that was previously formatted with goimport.
  2. The goimport command does not reformat code that was previously formatted with gosimport.
Created at 1 week ago
issue comment
Add better documentation for goimport local-prefixes

As a related note, there is a proposal to make goimports more opinionated about go import formatting: https://github.com/golang/go/issues/20818. There is also a project that effectively implements that proposal: https://github.com/rinchsan/gosimports. It would be nice to have a golangci-lint linter that validates whether imports are formatted according to the proposal. Either by introducing a new gosimport linter, or by adding a setting in the existing goimports linter to specify which command to use, e.g. goimport or gosimport.

Created at 1 week ago

chore: Add a clarifying note to the bug report template (#3355)

Co-authored-by: Fernandez Ludovic ldez@users.noreply.github.com

build(deps): bump golang.org/x/tools from 0.2.0 to 0.3.0 (#3358)

build(deps): bump golangci/golangci-lint-action from 3.3.0 to 3.3.1 (#3360)

Merge branch 'master' into importdocimprovement

Created at 1 week ago