Coder Social home page Coder Social logo

Comments (4)

srstevenson avatar srstevenson commented on June 30, 2024

I'm not able to reproduce this using the same versions of nb-clean and nbformat, either using the Git filter or invoking nb-clean manually:

$ nb-clean check plotly-example-2.ipynb
plotly-example-2.ipynb cell 0: metadata
plotly-example-2.ipynb cell 0: execution count
plotly-example-2.ipynb cell 0: outputs
plotly-example-2.ipynb metadata: language_info.version

However, I'm on Linux whereas you're on Windows and there's a warning from Git that LF line endings will be replaced with CRLF line endings on checkout in your output. To see if the line ending conversion is involved, do you have the same error if you run nb-clean outside the Git filter (nb-clean check plotly-example-2.ipynb)?

from nb-clean.

firezym avatar firezym commented on June 30, 2024

I can pass the $ nb-clean check plotly-example-2.ipynb on windows powershell command line too, returning the same results as you.

But when I use $ git add plotly-example-2.ipynb, I still get the same error showing above.

My CRLF setting in the git global config file C:\Users\Administrator\.gitconfig is as following

[core]
	autocrlf = input

Should I alter the autocrlf setting to something else?

from nb-clean.

srstevenson avatar srstevenson commented on June 30, 2024

According to this PR in another project, Jupyter notebooks are always created with LF line endings on Windows. That suggests adding the following to the .gitattributes file in your repository (if you've not worked with the .gitattributes file before, there's documentation on its purpose and the available options here):

*.ipynb  text eol=lf

from nb-clean.

srstevenson avatar srstevenson commented on June 30, 2024

I'll assume configuring .gitattributes worked: if you have any other trouble please open a new issue.

from nb-clean.

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.