Git Product home page Git Product logo

Comments (2)

felixbuenemann avatar felixbuenemann commented on June 23, 2024 3

Thanks for the explanation, that sounds like a lot of trouble. Closing for now, as I'm very busy as well.

from haml-lint.

sds avatar sds commented on June 23, 2024

Hey @felixbuenemann, thanks for the suggestion.

While I think this would be an awesome feature to have, the way haml-lint (and more specifically the HAML parser) is implemented makes it rather difficult to implement.

haml-lint integrates with rubocop by extracting Ruby code from a HAML document and creating a "fake" Ruby file to pass to rubocop. It then converts the line numbers reported by Rubocop to line numbers of the original HAML document (using a map generated during the extraction phase).

Running rubocop against this fake Ruby file with the --auto-correct flag, finding the differences, and trying to apply those differences back to the original HAML file, is a difficult problem, and will probably have a bunch of edge cases as the HAML parse tree does not have a 1-to-1 mapping to the original HAML source code IIRC (i.e. different HAML source files can correspond to the same parse tree, so a certain parse tree does not uniquely translate to a source file). That may not be a deal-breaker, but it certainly adds some complexity.

I would be open to a well-tested pull request if anyone wanted to tackle this, but I won't have the kind of time necessary to explore this particular feature myself.

from haml-lint.

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.