Giter Club home page Giter Club logo

Comments (3)

kungfujohnjon avatar kungfujohnjon commented on July 18, 2024 1

But overall, I don't think I see the utility in ignoring the column variable if it isn't a number or the value is less than zero but throwing an error if the number is greater than lineText.length. I feel like it makes more sense that both edge cases should be treated the same way, or that in the event that colStart is greater than or equal to lineText.length, that it be set to lineText.length - 1.

from atom-linter.

steelbrain avatar steelbrain commented on July 18, 2024

Columns in Atom are zero-indexed, instead of 1-indexed, so <= length would be incorrect. Can you apply the -1 on ranges from pylint and see if that resolves your issue?

from atom-linter.

kungfujohnjon avatar kungfujohnjon commented on July 18, 2024

It's probably not the newline then. The other indices returned from pylint seem to be accurate, but certain syntax errors in pylint (pylint 2.x at least) consistently give an index of lineText.length+1, and according to its self tests, this seems to be the expected return value. I don't see any other documentation for what that index is supposed to mean, but regardless, it seems there should at least be a way to suppress this exception for certain linters and set the index to either the end of the line or zero.

Since generateRange is doing the work of retrieving the lineText.length itself, there's not really a way to know it a priori without repeating much of the logic from generateRange beforehand to grab the line from the buffer and modify the column index outside of the function.

from atom-linter.

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.