All Projects → douglasfarinelli → pydecker

douglasfarinelli / pydecker

Licence: MIT License
Simple development tool that simplifies a pythonist's daily tasks.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to pydecker

Uncrustify
Code beautifier
Stars: ✭ 2,442 (+13466.67%)
Mutual labels:  format, code-style
programing-best-practices
A curated list of awesome Programming Best Practices For Good Developer 🥰
Stars: ✭ 67 (+272.22%)
Mutual labels:  code-style
romans
A Simple PHP Roman Numerals Library
Stars: ✭ 40 (+122.22%)
Mutual labels:  format
vscode-checkstyle
Haxe Checkstyle extension for Visual Studio Code
Stars: ✭ 24 (+33.33%)
Mutual labels:  code-style
format-date
📆 A small library (around 400 B when gziped & minified) to format JavaScript `Date` object using same tokens as moment.
Stars: ✭ 25 (+38.89%)
Mutual labels:  format
bcp-47-normalize
Normalize, canonicalize, and format BCP 47 tags
Stars: ✭ 16 (-11.11%)
Mutual labels:  format
elm-format-number
✨Format numbers as pretty strings
Stars: ✭ 56 (+211.11%)
Mutual labels:  format
teks
Easily get custom go template based outputs to your command-line tool. Like in docker/kubernetes
Stars: ✭ 41 (+127.78%)
Mutual labels:  format
prettier-check
Check that all files match prettier code style.
Stars: ✭ 54 (+200%)
Mutual labels:  code-style
unicode-formatter
Convert portions of text to fancy text using unicode fonts for use on Twitter and other sites that don't support rich text
Stars: ✭ 31 (+72.22%)
Mutual labels:  format
date-format
A reliable way to format dates and times in Elm.
Stars: ✭ 48 (+166.67%)
Mutual labels:  format
Bali
A fast and lightweight .Net library for reading and writing .class files.
Stars: ✭ 35 (+94.44%)
Mutual labels:  format
qoi-java
A pure Java 8 implementation of Quite OK Image Format
Stars: ✭ 30 (+66.67%)
Mutual labels:  format
con
A simple, fast and readable JSON-compatible serialization format
Stars: ✭ 22 (+22.22%)
Mutual labels:  format
ember-dayjs-helpers
Ember Template helpers based on day.js
Stars: ✭ 19 (+5.56%)
Mutual labels:  format
table
Produces a string that represents slice data in a text table, inspired by gajus/table.
Stars: ✭ 130 (+622.22%)
Mutual labels:  format
cfmt
Small library for simple and convenient formatted stylized output to the console.
Stars: ✭ 46 (+155.56%)
Mutual labels:  format
IosCodeSpecification
Ios best practices, Ios development specification, ios 开发规范,ios 最佳实践,ios编码规范
Stars: ✭ 43 (+138.89%)
Mutual labels:  code-style
comment-divider
Divide your code by sections with styled separators
Stars: ✭ 37 (+105.56%)
Mutual labels:  code-style
micell
A collection of functions for front-end development
Stars: ✭ 16 (-11.11%)
Mutual labels:  format

decker

Simple development tool that simplifies a pythonist's daily tasks.

PyPi Status Build Status Package version PyPI - Wheel


Decker is a command line, which aims to optimize some tasks, such as configuration and execution of the tools most used by the community. In addition, it aims to reduce configuration files and centralize everything on pyproject.toml.



Installation

The installation of decker can be via pip, pipenv, poetry or any other tool you prefer:

pipenv install decker

Note: We recommend installing only on virtualenv.

Features

Welcome to Decker!

  Simple development tool that simplifies a pythonist's daily tasks.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  format  Run code style format.

Format your code

  Run code style format.

Options:
  --exclude TEXT                  Files and directories that should be
                                  excluded on recursive searches.

  -l, --line-length INTEGER       How many characters per line to allow.
                                  [default: 79]

  -b, --backend [autoflake|docformatter|black|unify|isort]
                                  Specify formatting backends.
  --help                          Show this message and exit.

Formatting uses several tools, such as:

  • autoflake to remove unusable variables and imports,
  • docformatter to format docstrings,
  • black to apply your coding style, format blocks, constants, among other things,
  • unify to normalize quotes,
  • And last but not least, isort to reorganize your imports.

To save and avoid many configurations, decker pre defines some things like:

Tool Option Pré defined Description
autoflake expand-star-imports True Expand wildcard star imports with undefined names
autoflake in-place True Apply changes
autoflake recursive True Recursive to defined sources
autoflake remove-all-unused-imports True Remove all unused imports (not just those from the standard library)
autoflake remove-unused-variables True
docformatter blank False Remove blank line after description
docformatter in-place True Apply changes
docformatter make-summary-multi-line True Add a newline before and after the summary of a one-line docstring
docformatter pre-summary-newline True Add a newline before the summary of a multi-line docstring
docformatter recursive True Recursive to defined sources
docformatter wrap-summaries 79 (from decker global line-length setting) Wrap long summary lines
black line-length 79 (from decker global line-length setting) How many characters per line to allow
black skip-string-normalization False Skip string normalization to use unify to normalize
unify in-place True Apply changes
unify quote "'" (Single quote)
unify recursive True Recursive to defined sources
isort atomic True Ensures the output doesn't save if the resulting file contains syntax errors
isort case-sensitive True Tells isort to include casing when sorting module names
isort combine-as True Combines as imports on the same line
isort line-length 79 (from decker global line-length setting) How many characters per line to allow
isort lines-after-imports 2
isort multi-line 3 Multi line output (0-grid, 1-vertical, 2-hanging, 3-vert-hanging, 4-vert-grid, 5-vert-grid-grouped, 6-vert-grid-grouped-no-comma).
isort order-by-type True Order imports by type in addition to alphabetically
isort remove-import [__future__] Removes the specified import from all files
isort skip-glob *venv* Files that sort imports should skip over
isort trailing-comma True Includes a trailing comma on multi line imports that include parentheses
isort use-parentheses True Use parenthesis for line continuation on length limit instead of slashes

Note: Despite pre-defining all these settings, nothing is MANDATORY. All of these and any other configuration of these tools can be adjusted in pyproject.toml or in each configuration file of these tools.

The intention was to save time for those who already know and help those who do not already know.

Global Settings

To ensure ease and centralization of the other configurations, decker searches almost all of them in the pyproject.toml file, if any. Example:

[tool.autoflake]
expand-star-imports=false

[tool.black]
line-length=120
...

[tool.docformatter]
blank=false
...

[tool.unify]
quote='"'
...

[tool.isort]
line-length=120
trailing-comma=false
...

Decker settings on pyproject.toml

In addition, there are some that are global, where they are automatically passed on to all tools, such as:

[tool.decker]
line-length=79
exclude=same-package
verbose=1
sources=src/

Default sources (src/)

And to help as well, if the sources were not defined by the command line or pyproject.toml, decker looks for .py files in the directory in question and also for the src folder.

Extra

pdb++ & ipython

When installing decker, pdb++ and ipython are also installed to aid development.

Better print to pyproject.toml errors

Wraps and shows toml errors in a more "human" way, for example:

 + Unable to load pyproject.toml:
 |   
 |   [project]
 |   author='Douglas Farinelli'
 |   name='decker'
 |   repository='https://gitlab.com/douglasfarinelli/decker/'
 |   
 |   [tool.black]
 |   line-length=79
 |   skip-string-normalization=true
 |   target-version=
 |   
 + ^ Empty value is invalid
 |   
 |   ['py38']
 |   
 |   [tool.isort]
 |   atomic=true
 |   
 |   [tool.towncrier]
 |   package = 'crm'
 |   package_dir = 'src'
 |   filename = 'CHANGELOG.md'
 |   directory = 'changelog.d'

Next features

  • [0.2.0] - Command decker check

A command to analyze various things in your code, such as type hints, pep8 and Code quality.

  • [0.3.0] - Command decker release

Why not automate the flow VCS + bumpversion + towncrier? In other words, automate the generation of tags, changelog and auto-commit them.

Example:

decker release minor

License

This project is licensed under the terms of the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].