GithubHelp home page GithubHelp logo

Comments (4)

alexkohler avatar alexkohler commented on September 26, 2024 3

Hi, thanks for the issue (also, hello to a fellow Auroran 😄).

Presumably, the intention of this linter is to warn when people have written functions like runtime.Caller and should return a struct instead.

This is generally the intent, but dogsled itself was written around the heuristic that 3+ blank identifiers is usually a code smell. For example, your runtime.Caller example is ignoring the ok return value, which could lead to self being something other than the expected value (the file name). I could see the merit in configurable exclusions though. If you're using something like golangci-lint, you could also use their nolint directive or configure an exclude rule (https://golangci-lint.run/usage/false-positives/).

from dogsled.

mmcloughlin avatar mmcloughlin commented on September 26, 2024 1

You're at Aurora too! Nice :)

Thanks for pointing out the ok return from runtime.Caller. I've fixed it and re-enabled the linter.

I still think there's a potential issue here, and a similar point is raised in #2. Some kind of configurability would be good, like an ignore_outside_package flag or just an ignore list.

Thanks again!

from dogsled.

alexkohler avatar alexkohler commented on September 26, 2024

Some kind of configurability would be good, like an ignore_outside_package flag or just an ignore list.

Completely agree. Going to keep this issue open as I think this could be a good future enhancment, especially if dogsled is being used as a standalone tool.

from dogsled.

garrettthomaskth avatar garrettthomaskth commented on September 26, 2024

Hi, I am trying to use a //nolint:dogsled directive, but I am getting Error: directive //nolint:dogsled is unused for linter "dogsled" (nolintlint)
I think it is similar to this golangci/golangci-lint#1940

from dogsled.

Related Issues (3)

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.