Giter Site home page Giter Site logo

Comments (11)

keleshev avatar keleshev commented on July 4, 2024

Let me be devil's advocate for a second. Why would you ignore a rule?

from pydocstyle.

campbellr avatar campbellr commented on July 4, 2024

You might want to ignore certain rules for various reasons, either for purely subjective reasons (you just don't agree with it) or legacy projects where you just haven't convinced everyone to get entirely on the pep257 bandwagon.

Aside from the 'ignoring' use-case, the error codes just make the the project more friendly for external tools, so they don't have to depend on matching the human-readable version of the error, which may change.

from pydocstyle.

sigmavirus24 avatar sigmavirus24 commented on July 4, 2024

I think this is also more desirable in the context of Flake8 and the extension written for it using pep257. In general, having error codes with shorter descriptions are more in line with the other tools we already support and use. I didn't mention it because it doesn't particularly bother me since we're using pep257 as an extension. Were we introducing it as a core feature, I may have been a bit more concerned. That said, I agree that ignoring a rule is generally a bad idea, but rules are meant to be broken. :-P

from pydocstyle.

keleshev avatar keleshev commented on July 4, 2024

@sigmavirus24 do you have any suggestions for error code naming?

from pydocstyle.

sigmavirus24 avatar sigmavirus24 commented on July 4, 2024

Well easiest for Flake8 is to use a D (for doc-string)[1] followed by 3 or more numbers as you see fit (and to store them somewhere on the error object for us to use for ignoring). Generally similar errors are grouped in sort of classes like pep8 so you have 99 errors to report for each like idea, e.g., D1xx are all similar but different errors relating to essentially the same idea. D2xx works the same.

I don't recall the exact error strings as they are in pep257 now, but one of this week's nights I might be able to provide a suggestion for grouping the errors together. I have no good suggestions for shortening the messages though because I find them to be as terse as I can imagine them (while working on flake8-docstrings I thought about re-mapping the errors but couldn't think of better messages frankly).

[1]: Mainly because I used D in flake8-docstrings which integrates pep257 into flake8.

from pydocstyle.

keleshev avatar keleshev commented on July 4, 2024

D123 sounds good. I guess it will be a net-positive for Python community to allow to silence the errors, since otherwise many people wouldn't follow PEP 257 at all.

from pydocstyle.

JensRantil avatar JensRantil commented on July 4, 2024

D123 sounds good. I guess it will be a net-positive for Python community to allow to silence the errors, since otherwise many people wouldn't follow PEP 257 at all.

+1 I've had the opportunity to work with pep8 and like its concept of error codes.

from pydocstyle.

keleshev avatar keleshev commented on July 4, 2024

@JensRantil how did you use them?

from pydocstyle.

JensRantil avatar JensRantil commented on July 4, 2024

@JensRantil how did you use them?

I used them to skip a certain error that was incorrectly reported. I then filed a bug upstream.

from pydocstyle.

Nurdok avatar Nurdok commented on July 4, 2024

I'm working on this in my fork. Expect a pull request later today.

from pydocstyle.

Nurdok avatar Nurdok commented on July 4, 2024

I think this issue can be closed now.

from pydocstyle.

Related Issues (20)

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.