Giter Club home page Giter Club logo

Comments (2)

jerry-git avatar jerry-git commented on July 19, 2024

Thanks for the report!

First of all, I have to say that I'm a big fan of flake8 and linting in general.

The file that is triggering the error is a post save hook implementation that should be added as part of Jupyter configuration file (jupyter_notebook_config.py). The c refers to Config object which is automatically created and will be in the namespace when the post save hook implementation is loaded, see https://traitlets.readthedocs.io/en/latest/config.html#python-configuration-files.

I think the only reasonable way for fixing the linting error would be to add # noqa for that line. However, the post save hook implementation file is actually the only .py file currently in the project. Thus, I think setting up linting, especially for CI, is a bit overkill here.

I may use some .py files as complementary materials in the future but I'm not sure if linting will make sense for those either. For example, if exercises would contain .py files, those files would most likely include some errors / missing code that the learner should fix. Linter would not be happy about this.

However, it would maybe make sense to have some sort of linting for the notebooks, excluding the exercise notebooks. If someone knows a solution which does not introduce any boilerplate to notebook cells, I'd be interested. I checked the different approaches presented here https://stackoverflow.com/questions/26126853/verifying-pep8-in-ipython-notebook-code but I don't think any of those is suitable for my use case.

from learn-python3.

cclauss avatar cclauss commented on July 19, 2024

Agreed. Closing. For reference, the other way to placate flake8 on this score is to declare global c.

from learn-python3.

Related Issues (17)

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.