Giter Club home page Giter Club logo

Comments (2)

s-weigand avatar s-weigand commented on June 13, 2024

I'm not too sure about this feature 🤔
While I see the usefulness, I also see the problems in having a CLI linting tool manipulate a notebook (at least for now).

  1. Running a CLI tool on a notebook that changes it on disk, can leave you in limbo (true for all CLI tools). For example, imagine the following scenario:
  • You have unsaved changes, so the CLI tool does only knows about the saved changes.
  • Based on that knowledge it changes the notebook, which might lead to data loss.
  • You get prompted the "File changed do you want to 'Reload', 'Overwrite' or 'cancel' "
    The only clean way to prevent a scenario like this would be via an editor plugin that uses the following steps:
  • Save the notebook
  • Run the CLI tool
  • Reload the notebook from disk
    If you know a plugin that allows running an arbitrary CLI tool in that way please tell me 😄
  1. There already is jupyterlab-flake8 which directly gives you feedback in your notebook.

So at least until there is an editor plugin that could prevent such a scenario (e.g. for jupyterlab) I would put this on halt (if you really want this, PR's are welcome 😉 ).

from flake8-nb.

psychemedia avatar psychemedia commented on June 13, 2024

Re: overwriting - I generally get my cli tools to have an option to write to a new file, or even to a new default output file (out.py, ORIGINAL_FILENAME-revised.py etc).

If I get anywhere with a PR, I'll let you know...

from flake8-nb.

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.