Browse Source

Tweak isort config, add ./dev fmtpy shorthand for isort + black

rafalp 6 years ago
parent
commit
2a69319fb1
2 changed files with 6 additions and 1 deletions
  1. 2 1
      .isort.cfg
  2. 4 0
      dev

+ 2 - 1
.isort.cfg

@@ -1,5 +1,6 @@
 [settings]
 [settings]
-line_length=89
+include_trailing_comma=true
+line_length=88
 lines_after_imports=1
 lines_after_imports=1
 known_first_party=misago
 known_first_party=misago
 multi_line_output=3
 multi_line_output=3

+ 4 - 0
dev

@@ -89,6 +89,7 @@ intro() {
     echo "    ${BOLD}bash${NORMAL}              starts bash session inside running Misago container."
     echo "    ${BOLD}bash${NORMAL}              starts bash session inside running Misago container."
     echo "    ${BOLD}run${NORMAL}               runs \"docker-compose run --rm misago\"."
     echo "    ${BOLD}run${NORMAL}               runs \"docker-compose run --rm misago\"."
     echo "    ${BOLD}psql${NORMAL}              runs psql connected to development database."
     echo "    ${BOLD}psql${NORMAL}              runs psql connected to development database."
+    echo "    ${BOLD}fmtpy${NORMAL}             runs isort + black on python code."
     echo
     echo
 }
 }
 
 
@@ -310,6 +311,9 @@ if [[ $1 ]]; then
         run_psql
         run_psql
     elif [[ $1 = "psql_in_docker" ]]; then
     elif [[ $1 = "psql_in_docker" ]]; then
         psql_in_docker
         psql_in_docker
+    elif [[ $1 = "fmtpy" ]]; then
+        isort -rc misago
+        black devproject misago
     else
     else
         invalid_argument $1
         invalid_argument $1
     fi
     fi