Giter Site home page Giter Site logo

Comments (1)

liamappelbe avatar liamappelbe commented on July 20, 2024

At the moment we just split the file into lines and check if the line contains any of the ignore comments.

A full fix for this bug would involve parsing all the string literals, and only searching for the comments outside of the strings.

A quicker fix would be to switch from checking that the line contains the ignore comment to checking that it ends with it. We can't just check that the whole line matches (with optional white-space at the start), because it's common practice to put these lines at the end of a normal line of code.

This doesn't solve the problem for multi-line strings, where the comment could still appear on its own line, but hopefully that's an edge case on an edge case.

I'm also going to allow white-space after the comment, because otherwise there will be very tricky to debug errors:

// One of these is invalid:
// coverage:ignore-file
// coverage:ignore-file     

from coverage.

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.