{ "info": { "author": "Anthon van der Neut", "author_email": "a.van.der.neut@ruamel.eu", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Quality Assurance" ], "description": "*****\noitnb\n*****\n\n.. image:: https://bitbucket.org/ruamel/oitnb/raw/default/_doc/_static/license.svg\n :target: https://opensource.org/licenses/MIT\n\n.. image:: https://bitbucket.org/ruamel/oitnb/raw/default/_doc/_static/pypi.svg\n :target: https://pypi.org/project/oitnb/\n\n.. image:: https://bitbucket.org/ruamel/oitnb/raw/default/_doc/_static/oitnb.svg\n :target: https://bitbucket.org/ruamel/oitnb/\n\n\nThe uncompromising code formatter ``Black`` has very many good points, but by design\nit is not very flexible. If you cannot accept it as is ``oitnb`` might be an\nalternative for you.\n\nIn short, on top of ``Black``'s features, ``oitnb``:\n\n- defaults to single-quotes, but allows you to select double-quotes for\n strings (triple quotes and an empty string use double-quotes). Option ``--double``.\n- allows you to run `meld` for visual comparison of reformatted code,\n so you can easily insert some ``# fmt: off`` at appropriate places. Option ``--meld``.\n- reads your configuration in a format that you already know (Python) from a file\n that you most likely already have in your project anyway (``__init__.py``).\n- have project spanning base defaults in your configuration directory\n (XDG). That is e.g. where your line-length goes, that is carefully\n brought in sync with your editor width, the width of the three\n terminals fitting on your screen or your multi-file diff utility.\n- makes displaying icons optional. They might not display in your\n terminal in the first place, or not fit your professional environment.\n- has support for diffing against version committed to the project *before* starting to\n use ``oitnb``\n\n\nWork-in-progress/things planned:\n\n- triple quotes multi-line strings that start after the left\n parenthesis of a function. Option ``--multi-line-unwrap``. (A must\n if you write a lot of in-file , dedented, strings with YAML, as e.g.\n YAML library developer would.)\n- control spreading of multi-element list to one per line\n- your wish here (we can always make it a configuration option, command-line option)\n- keep alignment of EOL comments\n\nDetails\n=======\n\nCode base\n+++++++++\n\n``oitnb`` code is directly derived from ``Black``'s and uses many files\nas-is. \n\nIt can run most of ``Black``'s tests without problems but there is a\nhandful of errors, which should all have to do with hard-coded\nreferences to `Black` in both file content and file naming.\n\n\nExtra options, defaults and configuration\n+++++++++++++++++++++++++++++++++++++++++\n\nextra options: ``--double``, ``--meld``, ``--multi-line-unwrap``\n\n``oitnb`` defaults to single-quotes around strings, if you want to use\nthe quoting like ``Black`` has use the option ``--double`` option.\n\n``--meld`` which works like ``--diff``,\nbut for the invocation of ``meld`` on the original file and the\nreformatted version. ``meld`` allows you to directly edit the left\nhand side (original) so you can at that point decide to insert some\n``# fmt: off`` / ``# fmt: on`` comments around lines, or to abandon\nthe use of a formatter altogether.\n\nSpecifying ``--multi-line-unwrap`` runs an ugly post-processor on the reformatted lines\n**undoing** the rewrite of::\n\n x = yaml.load(\"\"\"\n a: 1\n b: 2\n \"\"\")\n\ninto::\n\n x = yaml.load(\n \"\"\"\n a: 1\n b: 2\n \"\"\"\n )\n\n\nThe program starts with an empty config dict and tries to read the basic\nconfiguration from ``oitnb.pon`` in the user config dir using\n``appdirs.user_config_dir``. This adheres to the XDG standard on Linux\n(i.e. ``~/.config/oitnb)`` if no environment variables are set to\nchange the defaults. That file should contain a valid Python dict\ndefinition ( with `{}` or `dict()`, and from this ``dict`` the value\nfor ``default`` is taken (using safe evaluation) to update the config dict::\n\n dict(\n default=dict(line_length=666, double=True),\n )\n\nAfter that the directory hierarchy up-the-tree is searched until\n``.git`` is found, or ``.hg`` or an ``__init__.py`` file with a module\nlevel definition of ``_package_data``. That should be a dict and from\nthere the value for the key ``oitnb`` is taken to update the\nconfig::\n\n _package_data = dict(\n oitnb=dict(line_length=88),\n )\n \n``oitnb``'s ``__init__.py`` has more information there used (without ``import``-ing!), and\nprogrammatically updated, by other tools::\n\n _package_data = dict(\n full_package_name='oitnb',\n version_info=(0, 1, 1),\n __version__='0.1.1',\n author='Anthon van der Neut',\n author_email='a.van.der.neut@ruamel.eu',\n description=\"oitnb works around some of black's issues\",\n entry_points='oitnb=oitnb:main',\n license='MIT',\n since=2018,\n status=alpha,\n package_data={\"_oitnb_lib2to3\": [\"*.txt\"]},\n install_requires=['click>=6.5', 'attrs>=17.4.0', 'appdirs', 'toml>=0.9.4'],\n test_suite=\"_test.test_oitnb\",\n tox=dict(\n env='36', \n ),\n oitnb=dict(line_length=88),\n )\n \n \n version_info = _package_data['version_info']\n __version__ = _package_data['__version__']\n \n\nOn top of this, any command-line options are used to overrule the config, and\nthen the program is initialised. \n\nDashes (`-`) in options are internally replaced by underscore (`_`),\nyou can use that form as key in `dict(op_tion=True)`. With dashes you\nwould need to use `{\"op-tion\": True}`\n\nThere is currently no computer wide, setting for defaults, such as\n``/etc/xdg/oitnb`` (is anyone sharing their development machines these\ndays?).\n\nFinding changes against pre-``oitnb`` revisions\n+++++++++++++++++++++++++++++++++++++++++++++++\n\nIf you have an existing project with revision history, and apply\n``oitnb`` to your sources, then diffing between pre- and\npost-``oitnb`` versions is going to be cluttered.\n\nIf your application of ``oitnb`` was applied without Internal errors, and if you did\nnot have to apply ``# fmt: no`` to often, then you can use the\nfollowing to get more useful visual diffs using ``meld``.\n\nThe installation of ``oitnb`` includes a minimal utility ``omeld``,\nadd this as an external diff tool to your mercurials ``.hgrc`` file::\n\n [extensions]\n hgext.extdiff =\n \n [extdiff]\n cmd.omeld =\n \nNow you can execute ``hg omeld -r-4 -r-1`` or ``hg omeld -r-4``\n(assuming revision -4 was from before applying ``oitnb``) and\n``omeld`` will run ``oitnbt`` on both temporarily created source\ntrees, before handing those trees over to ``meld``. That means\ne.g. that any source changes regarding quotes or removal of\nsuperfluous u's from u'' strings, rewrapping, etc. are going to be the same for both\nsides of the revisions. Thereby leaving the real code changes in the\ndiff that ``meld`` presents.\n\nIf the omeld tools gets a file or directory as argument that is **not**\nunder ``/tmp`` or ``/var/tmp``, it will not run ``oitnb`` on that\nfile/directory. If you keep your source tree under ``/var/tmp``, you are\nout of luck: your python will be formatted.\n\nThe above approach: *check out both (old) revisions trees, code format\nthem with ``oitnb`` and run a diff*, is generic. ``meld`` and ``mercurial`` are just\nthe tools I use and can easily provide a working setup for.\n\nFor git, which in my experience is a bit more difficult to get to\nunderstand multiple external difftools, you can do::\n\n alias gomeld='git difftool --extcmd=omeld -y'\n\nand use that alias.\n\n``git`` seems somewhat more optimised than ``hg`` in that if the current checked out\nversion of a file is the same as one of the reversions asked, that it\nwill not make a temporary version (not even if you have to compare\nmultiple files). Versions before 0.1.4 should therefore not be used\nwith the above alias, as those may result updated files\nin your source tree (which should not break anything, but not be what\nyou expected).\n\n\nProblems you might encounter with Black\n=======================================\n\nDouble-quotes everywhere\n++++++++++++++++++++++++\n\nIf you use single-quotes for your strings you are in good company:\n`\"People use to really love double quotes. I don't know\nwhy. `__. \nAnd as PEP8 has the following to say about quotes around strings::\n\n In Python, single-quoted strings and double-quoted strings are the same. This PEP \n does not make a recommendation for this. Pick a rule and stick to it.\n\nGoogling for *Stick to it*: continue or confine oneself to doing or using a particular thing.\n\nIt is not just the consistency of confining yourself, it is also the long term continuation.\n\n\nUnwrapping where a second line might do\n+++++++++++++++++++++++++++++++++++++++\n\nIf you have a list of short strings that fit on a line and add one so\nthat it doesn't fit anymore, \n\nyou \n\ndon't \n\nwant \n\nthat\n\nto\n\nall \n\nof\n\na \n\nsudden\n\nforce\n\nevery \n\nsingle\n\nelement \n\non a new line. Just putting the added overflow on a new line is good enough in those cases.\n\nFunny characters\n++++++++++++++++\n\nThe Unicode in the messages might not display in the font\nyou're using (they did not for me with Inconsolata in my Gnome Terminal). Do you\nknow what those code-points should show? If not, are you sure that when\nusing ``Black`` on a different computer, while the person who pays you\nfor your work looks over your shoulder, that you'll not be embarrassed (or get into\ntrouble if e.g. they were code-points U+5350 or U+0FD5)?\n\nYou might find seeing the SLEEPING FACE (U+1F634), SHORTCAKE (U+1F370),\nCOLLISION SYMBOL (U+1F4A5), BROKEN HEART (U+1F494), SPARKLES (U+2728)\ninteresting for a while. But especially when using a small font in order not to scroll too much the details become blurry and no-fun.\n\nLittle configurability\n++++++++++++++++++++++\n\nThe configurability of Black consists inserting lines in Yet Another\nMarkup Format that adds nothing to the existing spectrum in Yet\nAnother Config File cluttering your project directory.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/ruamel/oitnb", "keywords": "automation formatter black pep8", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "oitnb", "package_url": "https://pypi.org/project/oitnb/", "platform": "", "project_url": "https://pypi.org/project/oitnb/", "project_urls": { "Homepage": "https://bitbucket.org/ruamel/oitnb" }, "release_url": "https://pypi.org/project/oitnb/0.1.5/", "requires_dist": null, "requires_python": ">=3.6", "summary": "oitnb works around some of black's issues", "version": "0.1.5" }, "last_serial": 4135645, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "95e7545d8ad3db7870e96acacd6964b9", "sha256": "4b2a5b90956286a903fd52c78e93c304aa8c735f5abbdf625699cd9753a1eba3" }, "downloads": -1, "filename": "oitnb-0.1.2-py36-none-any.whl", "has_sig": false, "md5_digest": "95e7545d8ad3db7870e96acacd6964b9", "packagetype": "bdist_wheel", "python_version": "py36", "requires_python": ">=3.6", "size": 77673, "upload_time": "2018-08-02T10:54:22", "url": "https://files.pythonhosted.org/packages/99/f7/9992db9c52c28e42766182ffa8afcab348f5cfb407240493781e4dd31a9f/oitnb-0.1.2-py36-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b7d2ca072f09b7be0729a77bcda40843", "sha256": "d230447e98ccadf1c8dc84adc44044a3f6289b1b440319f1aa896a676a180833" }, "downloads": -1, "filename": "oitnb-0.1.2-py37-none-any.whl", "has_sig": false, "md5_digest": "b7d2ca072f09b7be0729a77bcda40843", "packagetype": "bdist_wheel", "python_version": "py37", "requires_python": ">=3.6", "size": 77670, "upload_time": "2018-08-02T10:54:24", "url": "https://files.pythonhosted.org/packages/0b/7d/714cd6422cfeaa2c72221555a645d559a43fd0a11ef42f920b52f6f5362e/oitnb-0.1.2-py37-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e7381a5bb7e02835f2843905a23a9638", "sha256": "5b63ac1a7aa7fd1ca3964ab2a15148923bbe576802a3646c9e01c0eb68bb9a5a" }, "downloads": -1, "filename": "oitnb-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e7381a5bb7e02835f2843905a23a9638", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 81172, "upload_time": "2018-08-02T10:09:05", "url": "https://files.pythonhosted.org/packages/20/92/3d82677ff782cff59ab86da41c910bc338ba6f66b2fc80a3b1765e52ca9b/oitnb-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "ff257c5e739cc922addfbce1c25eb435", "sha256": "48ed78ba0f26f103ccd587aedcc08181445a8484d1c4fe901ec6084bf39a9728" }, "downloads": -1, "filename": "oitnb-0.1.3-py36-none-any.whl", "has_sig": false, "md5_digest": "ff257c5e739cc922addfbce1c25eb435", "packagetype": "bdist_wheel", "python_version": "py36", "requires_python": ">=3.6", "size": 79650, "upload_time": "2018-08-03T12:46:34", "url": "https://files.pythonhosted.org/packages/85/3c/97595f85b37c049a104ac1100071835cb030650168bd256470041b236f0b/oitnb-0.1.3-py36-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c3c26c38f86c37c9d2340046978b2465", "sha256": "161f93a25adc94642d007b8ce263181885207c2b4dbd400b20f3ba9ddc12988c" }, "downloads": -1, "filename": "oitnb-0.1.3-py37-none-any.whl", "has_sig": false, "md5_digest": "c3c26c38f86c37c9d2340046978b2465", "packagetype": "bdist_wheel", "python_version": "py37", "requires_python": ">=3.6", "size": 79651, "upload_time": "2018-08-03T12:46:35", "url": "https://files.pythonhosted.org/packages/a0/f2/b62eed22e099cee2b9eb9bd5c6ca3d86658d44d8fb491e7c11410c2c6514/oitnb-0.1.3-py37-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7fec8fdf394af921463935cecf8b6f16", "sha256": "8f9b06fb2bca302c2c3c66808c5feecba2deb969b1af7c104ae025e7cc54dbcf" }, "downloads": -1, "filename": "oitnb-0.1.3.tar.gz", "has_sig": false, "md5_digest": "7fec8fdf394af921463935cecf8b6f16", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 83841, "upload_time": "2018-08-03T12:46:31", "url": "https://files.pythonhosted.org/packages/13/42/eb5c42fc74756123d67b1fbfec08f0510ae28f7f2e94d2beff7ade0e6d07/oitnb-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "6bb35f75d5d4013d7c52ebb3fc57eb6f", "sha256": "c1ab28440625bd108c70433580b83c88ba40bd501144a60c2b5aad08b5711fbb" }, "downloads": -1, "filename": "oitnb-0.1.4-py36-none-any.whl", "has_sig": false, "md5_digest": "6bb35f75d5d4013d7c52ebb3fc57eb6f", "packagetype": "bdist_wheel", "python_version": "py36", "requires_python": ">=3.6", "size": 80420, "upload_time": "2018-08-04T14:08:44", "url": "https://files.pythonhosted.org/packages/4c/d7/766f67b0f58cd40bc35a055cf54f5d5b3499ab2f784bee7c8f2c38f2dbfe/oitnb-0.1.4-py36-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f0addc91395fe077b8b256154447bd31", "sha256": "e00b70fa399430d906b32389f295d14fe09d139953c02130c344717d351be0e1" }, "downloads": -1, "filename": "oitnb-0.1.4-py37-none-any.whl", "has_sig": false, "md5_digest": "f0addc91395fe077b8b256154447bd31", "packagetype": "bdist_wheel", "python_version": "py37", "requires_python": ">=3.6", "size": 80420, "upload_time": "2018-08-04T14:08:46", "url": "https://files.pythonhosted.org/packages/1c/b7/a037f934e2fbcd8e33023b067cddcfca682d0aa2cf18f7d9b248b1138f34/oitnb-0.1.4-py37-none-any.whl" }, { "comment_text": "", "digests": { "md5": "79b6ffcf18b621a0e6467210738a4cde", "sha256": "52f86fafb04c5986c18eca1954cb98e2937d8d19fc68ec2ebb1c24069bb184ac" }, "downloads": -1, "filename": "oitnb-0.1.4.tar.gz", "has_sig": false, "md5_digest": "79b6ffcf18b621a0e6467210738a4cde", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 84973, "upload_time": "2018-08-04T14:08:42", "url": "https://files.pythonhosted.org/packages/2a/b7/06657487f43041e0764c4883d0d7768238179455318a2ce2ffcd0a420eaa/oitnb-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "c1855e3679ef4be1f5712e77f6128535", "sha256": "08869842568c7032cf71ac9fa021e4db4c98f0e8cfeedc7c7c695b347a7ab82e" }, "downloads": -1, "filename": "oitnb-0.1.5-py36-none-any.whl", "has_sig": false, "md5_digest": "c1855e3679ef4be1f5712e77f6128535", "packagetype": "bdist_wheel", "python_version": "py36", "requires_python": ">=3.6", "size": 80543, "upload_time": "2018-08-04T15:28:07", "url": "https://files.pythonhosted.org/packages/fd/84/fa2714083b6ad6f9a13d11ce79b9a042e4f996c1bf79d31c4c76080a6297/oitnb-0.1.5-py36-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ffbca27e4d62d76a6202815c48a83e82", "sha256": "854992915c452c28f57b7d6ff3043483f7e1778df2faa08ac0f8e21128b4d8b0" }, "downloads": -1, "filename": "oitnb-0.1.5-py37-none-any.whl", "has_sig": false, "md5_digest": "ffbca27e4d62d76a6202815c48a83e82", "packagetype": "bdist_wheel", "python_version": "py37", "requires_python": ">=3.6", "size": 80543, "upload_time": "2018-08-04T15:28:09", "url": "https://files.pythonhosted.org/packages/e7/83/ca852718e058111eca97d779cdb242ec6c211f5f2d8cf089888d362f4d59/oitnb-0.1.5-py37-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d2c6ffced0119ca741d595fb9e4dc00", "sha256": "6a9628b9b902ac2182379ddd649e44805b10315a91911a7c32d95ae32fb8133d" }, "downloads": -1, "filename": "oitnb-0.1.5.tar.gz", "has_sig": false, "md5_digest": "5d2c6ffced0119ca741d595fb9e4dc00", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 85147, "upload_time": "2018-08-04T15:28:05", "url": "https://files.pythonhosted.org/packages/d8/08/5cce468f0c417affe5142476c16aca827e0b7c8ce4a5f2b9ae34fe055772/oitnb-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c1855e3679ef4be1f5712e77f6128535", "sha256": "08869842568c7032cf71ac9fa021e4db4c98f0e8cfeedc7c7c695b347a7ab82e" }, "downloads": -1, "filename": "oitnb-0.1.5-py36-none-any.whl", "has_sig": false, "md5_digest": "c1855e3679ef4be1f5712e77f6128535", "packagetype": "bdist_wheel", "python_version": "py36", "requires_python": ">=3.6", "size": 80543, "upload_time": "2018-08-04T15:28:07", "url": "https://files.pythonhosted.org/packages/fd/84/fa2714083b6ad6f9a13d11ce79b9a042e4f996c1bf79d31c4c76080a6297/oitnb-0.1.5-py36-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ffbca27e4d62d76a6202815c48a83e82", "sha256": "854992915c452c28f57b7d6ff3043483f7e1778df2faa08ac0f8e21128b4d8b0" }, "downloads": -1, "filename": "oitnb-0.1.5-py37-none-any.whl", "has_sig": false, "md5_digest": "ffbca27e4d62d76a6202815c48a83e82", "packagetype": "bdist_wheel", "python_version": "py37", "requires_python": ">=3.6", "size": 80543, "upload_time": "2018-08-04T15:28:09", "url": "https://files.pythonhosted.org/packages/e7/83/ca852718e058111eca97d779cdb242ec6c211f5f2d8cf089888d362f4d59/oitnb-0.1.5-py37-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d2c6ffced0119ca741d595fb9e4dc00", "sha256": "6a9628b9b902ac2182379ddd649e44805b10315a91911a7c32d95ae32fb8133d" }, "downloads": -1, "filename": "oitnb-0.1.5.tar.gz", "has_sig": false, "md5_digest": "5d2c6ffced0119ca741d595fb9e4dc00", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 85147, "upload_time": "2018-08-04T15:28:05", "url": "https://files.pythonhosted.org/packages/d8/08/5cce468f0c417affe5142476c16aca827e0b7c8ce4a5f2b9ae34fe055772/oitnb-0.1.5.tar.gz" } ] }