PyDev Formatter
===============
.. image:: https://img.shields.io/pypi/v/pydevf.svg
:target: https://pypi.python.org/pypi/pydevf
.. image:: https://img.shields.io/travis/fabioz/PyDev.Formatter.svg
:target: https://travis-ci.org/fabioz/PyDev.Formatter
Features
==========
This package provides a command line API to use the PyDev Code Formatter (the PyDev
Code formatter is created by extracting the engine for code formatting provided by
PyDev: http://www.pydev.org).
The PyDev Formatter is a conservative python code formatter and will try to keep the
structure of the code as close as possible to the original sources, while fixing many
common issues such as:
- Keep a space after commas
- Trim spaces inside parenthesis
- Right-trim lines
- Add a space before and after operators
- Keep 2 lines before top level classes/methods
- Keep 1 line before inner classes/methods
- Add new line at end of file
- Format comments to have 2 spaces before a comment and 1 space inside the comment
Note that it does not try to break statements to fit any pre-specified line length (as gofmt).
Command line
=============
Basic use of the formatter is:
``python -m pydevf <filename_or_directory>``
``python -m pydevf -h`` may be used to see the help for additional parameters.
Installing
============
Requisites
-----------
- java 8+ (so, make sure java is installed and in your PATH)
- python 2.7 or 3.4 onwards
- click 6+
Install with pip
-----------------
To install the PyDev Formatter use:
``pip install pydevf``
Using with pre-commit
---------------------
To use it with `pre-commit`_, just add the following repo to your ``.pre-commit-config.yaml``::
- repo: https://github.com/fabioz/PyDev.Formatter
rev: '' # Use the sha or tag you want to point at
hooks:
- id: pydevf
.. _pre-commit: https://pre-commit.com/
Dealing with big lines
========================
Note that in PyDev there are tools to help on those manual cases. i.e.:
Wrap docstrings/comments with ``Ctrl+2, W`` -- See: http://pydev.blogspot.com/2015/04/wrapping-docstringscomments-in-pydev.html.
Wrap/unwrap lists/calls with ``Ctrl+1``, ``Wrap expression``/``Unwrap expression`` (used with cursor inside the list/call).
Daemon mode
============
By default the formatter will create a daemon and will reuse it among multiple invocations (because
the formatter is **very fast** but its startup is slow). If you don't want to use this mode use
the ``--no-daemon`` parameter.
License
==========
* EPL (Eclipse Public License) 2.0
Releasing
==========
- Update versions on ``setup.py`` and ``version.py``
- ``git tag {{version}}`` (i.e.: v0.1.2)
- ``git push --tags`` (travis should build and deploy)
Local release
---------------
- Update versions on ``setup.py`` and ``version.py``
- ``python setup.py sdist bdist_wheel``
- ``python -m twine upload dist/*``
=======
History
=======
0.1.0 (2018-06-12)
------------------
* First release on PyPI.
Metadata
Release files for pydevf 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydevf-0.1.5.tar.gz | 2.9 MB | Without provenance | Details for pydevf-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydevf-0.1.5-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for pydevf-0.1.5-py2.py3-none-any.whl |
Total release size: 5.7 MB
Release files / pydevf-0.1.5.tar.gz
| Download URL | pydevf-0.1.5.tar.gz |
|---|---|
| Size | 2.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad74aab0a0ecf84acf3792d600495e9df16dc8c24e5381b35eb25e50234d6f69
|
|
BLAKE2b-256 checksum How to use checksums |
3e10f8688fd08a5367cb60e254abda286de59e653d2d55773ee1937bbe4e36df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pydevf-0.1.5-py2.py3-none-any.whl
| Download URL | pydevf-0.1.5-py2.py3-none-any.whl |
|---|---|
| Size | 2.8 MB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
3686bd3d83faf77facd99f1933969b44fa6f71636e7d0e791384019807eecc5b
|
|
BLAKE2b-256 checksum How to use checksums |
9dd9d22b4aef4b315e9bdd2342b32d97f5f1db7c57bdd41e617323db0ac25718
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pydevf 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.