Metadata-Version: 2.5
Name: tukuroi
Version: 3.0.0
Summary: A lint framework that writes better Python code for you.
Project-URL: Home, https://github.com/Fkinds/tukuroi
Project-URL: Documentation, https://fkinds.github.io/tukuroi/
Project-URL: Github, https://github.com/Fkinds/tukuroi
Project-URL: Changelog, https://github.com/Fkinds/tukuroi/blob/main/CHANGELOG.md
Author: Meta Platforms, Inc, Amethyst Reese, Jimmy Lai, Zsolt Dollenstein
Maintainer: Fkinds
License: MIT License
        
        Copyright (c) Facebook, Inc. and its affiliates.
        Copyright (c) 2026 Fkinds
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
        -------------------------------------------------------------------------------
        
        PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
        
        1. This LICENSE AGREEMENT is between the Python Software Foundation
        ("PSF"), and the Individual or Organization ("Licensee") accessing and
        otherwise using this software ("Python") in source or binary form and
        its associated documentation.
        
        2. Subject to the terms and conditions of this License Agreement, PSF hereby
        grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
        analyze, test, perform and/or display publicly, prepare derivative works,
        distribute, and otherwise use Python alone or in any derivative version,
        provided, however, that PSF's License Agreement and PSF's notice of copyright,
        i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
        2011, 2012, 2013, 2014, 2015 Python Software Foundation; All Rights Reserved"
        are retained in Python alone or in any derivative version prepared by Licensee.
        
        3. In the event Licensee prepares a derivative work that is based on
        or incorporates Python or any part thereof, and wants to make
        the derivative work available to others as provided herein, then
        Licensee hereby agrees to include in any such work a brief summary of
        the changes made to Python.
        
        4. PSF is making Python available to Licensee on an "AS IS"
        basis.  PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
        IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
        DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
        FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
        INFRINGE ANY THIRD PARTY RIGHTS.
        
        5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
        FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
        A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
        OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
        
        6. This License Agreement will automatically terminate upon a material
        breach of its terms and conditions.
        
        7. Nothing in this License Agreement shall be deemed to create any
        relationship of agency, partnership, or joint venture between PSF and
        Licensee.  This License Agreement does not grant permission to use PSF
        trademarks or trade name in a trademark sense to endorse or promote
        products or services of Licensee, or any third party.
        
        8. By copying, installing or otherwise using Python, Licensee
        agrees to be bound by the terms and conditions of this License
        Agreement.
        
        -------------------------------------------------------------------------------
        
        APACHE LICENSE, VERSION 2.0
        
        http://www.apache.org/licenses/LICENSE-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.14
Requires-Dist: click<9,>=8.3.3
Requires-Dist: moreorless>=0.4.0
Requires-Dist: pathspec>=1.0
Provides-Extra: lsp
Requires-Dist: pygls~=2.1.1; extra == 'lsp'
Provides-Extra: pretty
Requires-Dist: rich>=12.6.0; extra == 'pretty'
Provides-Extra: ruff
Requires-Dist: ruff>=0.17.3; extra == 'ruff'
Description-Content-Type: text/x-rst

tukuroi is an **unofficial fork** of `Instagram/Fixit
<https://github.com/Instagram/Fixit>`_, the linting framework that Meta
published. It is not affiliated with Meta, nor endorsed by Meta or by the
maintainers of Fixit. Its main differences from upstream:

- The rules run on a new engine, ``tukuroi.core``, built on Python's ``ast``
  module in place of LibCST.
- Safer handling of untrusted repositories: ``--no-custom-rules`` keeps
  tukuroi from importing any rules but its built-in ones, the search for
  configurations stops at the root of the repository, output templates take
  only the names of their fields, and the LSP server talks over stdio only.
- It supports only the two newest minor versions of CPython: 3.14 and 3.15.

tukuroi provides a highly configurable linting framework with support for
auto-fixes, custom "local" lint rules, and hierarchical configuration, built
on Python's ``ast`` module. A fix replaces only the code that it fixes; a
project can choose to format the fixed files with
`ruff <https://docs.astral.sh/ruff/>`_ (``pip install "tukuroi[ruff]"``).

tukuroi makes it quick and easy to write new lint rules and offer suggested
changes for any errors found, which can then be accepted automatically,
or presented to the user for consideration.

For more details, see the `user guide`__.

.. __: https://fkinds.github.io/tukuroi/guide.html

.. QUICKSTART


Coming from Fixit
-----------------

tukuroi reads none of the names of Fixit. Rename them:

.. list-table::
    :header-rows: 1

    * - Fixit
      - tukuroi
    * - ``pip install fixit``
      - ``pip install tukuroi``
    * - ``fixit lint``, ``python -m fixit``
      - ``tukuroi lint``, ``python -m tukuroi``
    * - ``[tool.fixit]``, ``[[tool.fixit.overrides]]``
      - ``[tool.tukuroi]``, ``[[tool.tukuroi.overrides]]``
    * - ``fixit.toml``, ``.fixit.toml``
      - ``tukuroi.toml``, ``.tukuroi.toml``
    * - ``FIXIT_CUSTOM_RULES``
      - ``TUKUROI_CUSTOM_RULES``
    * - ``fixit.rules``
      - ``tukuroi.rules``, with fewer rules: ruff has the others (see the
        `ruff guide`__)
    * - the pre-commit hooks ``fixit-lint`` and ``fixit-fix``
      - ``tukuroi-lint`` and ``tukuroi-fix``
    * - ``fixit_paths``, ``fixit_file``, ``fixit_bytes``
      - ``tukuroi_paths``, ``tukuroi_file``, ``tukuroi_bytes``
    * - ``output-format = "fixit"``, ``--output-format fixit``
      - ``output-format = "tukuroi"``, ``--output-format tukuroi``
    * - the LSP server ``fixit-lsp``, and the source ``fixit`` of its
        diagnostics
      - ``tukuroi-lsp``, and the source ``tukuroi``

.. __: https://fkinds.github.io/tukuroi/guide.html#ruff-rules

A config of Fixit that tukuroi does not read is a warning: a ``fixit.toml``, a
``.fixit.toml``, or a ``[tool.fixit]`` in ``pyproject.toml``, in a directory
with no config of tukuroi. To keep one for Fixit and run tukuroi with its
defaults, put an empty ``[tool.tukuroi]`` (or an empty ``tukuroi.toml``) next to
it.

The settings of Fixit that tukuroi does not support (``python-version``,
``options``, ``tags``) are configuration errors that say so. ``formatter`` takes
``"ruff"`` or ``"none"`` only, not ``"black"`` or ``"ufmt"``.

The rules of Fixit do not run on tukuroi: they are written for LibCST, and
tukuroi uses ``ast``. To port a rule:

.. list-table::
    :header-rows: 1

    * - Fixit
      - tukuroi
    * - a subclass of ``fixit.LintRule``, visiting LibCST nodes
      - a subclass of ``tukuroi.Rule``, with ``visit_<node>`` methods named
        after the classes of ``ast``
    * - ``METADATA_DEPENDENCIES`` and ``QualifiedNameProvider``
      - ``self.imports.qualified_names(node)``
    * - a LibCST node as the ``replacement``
      - a string as the ``replacement``, or ``edits`` over the original text
    * - ``fixit.testing.add_lint_rule_tests_to_module``
      - ``tukuroi.testing.add_rule_tests_to_module``
    * - ``fixit.config.collect_rules(Config(...))``
      - ``tukuroi.config.load_rules(Config(...))``; ``Config`` has no
        ``python_version``

See `Writing Rules`__ for the details.

.. __: https://fkinds.github.io/tukuroi/guide.html#writing-rules


License
-------

tukuroi is `MIT licensed`__, as found in the LICENSE file.

.. __: https://github.com/Fkinds/tukuroi/blob/main/LICENSE
