I’m getting an IndentationError. How do I fix it?

Why does indentation matter? In Python, indentation is used to delimit blocks of code. This is different from many other languages that use curly braces {} to delimit blocks such as Java, Javascript, and C. Because of this, Python users must pay close attention to when and how they indent their code because whitespace matters. … Read more

IntelliJ IDEA code format from checkstyle configuration

finally there is something: checkstyle-IDEA since 4.24.0 features import of checkstyle config. A solution is available now: Please install CheckStyle-IDEA plugin (http://plugins.jetbrains.com/plugin/1065?pr=idea), it can be found via plug-in repository (Settings|Plugins|Browse repositories). Go to Settings|Editor|Code Style, choose a code style you want to import CheckStyle configuration to. Click Manage…|Import.., choose “CheckStyle Configuration” and select a corresponding … Read more

SQL string formatter [closed]

Try sqlparse module’s sqlformat Check out sqlparse. It is a Python module that installs the command sqlformat. Usage is simple, e.g.: sqlformat –reindent –keywords upper –identifiers lower my_file.sql Example: $ echo “sElECt f1,f2,fname,lName FrOm tblName WhErE f1=true aNd fname iS nOt null oRdEr bY lName aSc” | \ sqlformat – –reindent –keywords upper –use_space_around_operators SELECT … Read more