infer-actively / pymdp

A Python implementation of active inference for Markov Decision Processes
MIT License
450 stars 89 forks source link

Not sure linting step in github actions is doing what it was expected to do.. #138

Open scott-carroll-verses-ai opened 3 months ago

scott-carroll-verses-ai commented 3 months ago

.github/workflows/python-package.yml:

    - name: Lint with flake8
      run: |
        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

While it is true that the code gets linted, it happens in context of a github docker image and is lost after the tests are run.

If you want auto-linting to happen before commits, there are a variety of ways to do it, but I suggest looking into precommit. If you set expectations that code is linted before commit, this step can be updated so that it fails if the linting results in changing the files at all, because it implies that the files weren't linted prior to committing.

Nothing is perfect and there are ways around any such solution, but you can see how we're using precommit to make sure that static artifacts are build correctly before commits here: https://github.com/VersesTech/c4-verses-ai/blob/main/.pre-commit-config.yaml