Giter Site home page Giter Site logo

Comments (5)

DRMacIver avatar DRMacIver commented on May 12, 2024

And here's an ill formed example that generates a similar exception. I leave it as an exercise for the amused reader to figure out how I accidentally hit upon this one:

echo 'from . import foo'

(Yes, you put that code in a python file)

from yapf.

DRMacIver avatar DRMacIver commented on May 12, 2024

Ah! I understand what's going on now.

You will get this error if you try to format a file where the last character of the file is not whitespace. This will probably mean that you can't reproduce any of the above by copying and pasting them.

from yapf.

bwendling avatar bwendling commented on May 12, 2024

Yeah. lib2to3 is sensitive like that. I could enforce a newline at the end of the source code. That might work?

from yapf.

DRMacIver avatar DRMacIver commented on May 12, 2024

Sounds good to me. Normalising end of file whitespace is something I'd want out of a code formatter anyway.

from yapf.

bwendling avatar bwendling commented on May 12, 2024

Fixed here: c80d69c

from yapf.

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.