Skip to content

Instantly share code, notes, and snippets.

@abdellatifLabr
Last active April 19, 2021 13:30
Show Gist options
  • Save abdellatifLabr/426e737154db93c531167d4119ec386e to your computer and use it in GitHub Desktop.
Save abdellatifLabr/426e737154db93c531167d4119ec386e to your computer and use it in GitHub Desktop.
Python Django formatting and linting configuration

Isort

[settings]
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
multi_line_output = 3
include_trailing_comma = true
skip_gitignore = true

Pylint

load-plugins=pylint_django
django-settings-module=loyaltydish.settings

VSCode

{
  "editor.formatOnSave": true,
  "python.linting.pylintEnabled": true,
  "python.sortImports.args": [
    "-sp .isort.cfg"
  ],
  "python.formatting.autopep8Args": [
    "--max-line-length",
    "200"
  ],
  "[python]": {
    "editor.codeActionsOnSave": {
      "source.organizeImports": true
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment