Root dir of the project

Nitpick tries to find the root dir of the project using some hardcoded assumptions.

  1. Starting from the current working directory, it will search for files that are usually in the root of a project:

  • .pre-commit-config.yaml (pre-commit)

  • pyproject.toml


  • setup.cfg

  • requirements*.txt

  • Pipfile (Pipenv)

  • tox.ini (tox)

  • package.json (JavaScript, NodeJS)

  • Cargo.* (Rust)

  • go.mod, go.sum (Golang)

  • and (Flask CLI)

  • (Flask)

  1. If none of these root files were found, search for On Django projects, it can be in another dir inside the root dir (issue 21).

  2. If multiple roots are found, get the top one in the dir tree.

Main Python file

After finding the root dir of the project, Nitpick searches for a main Python file. Every project must have at least one *.py file, otherwise flake8 won’t even work.

Those are the Python files that are considered:


  • and (Flask CLI)



  • any *.py file