clang-tools


Nameclang-tools JSON
Version 0.12.1 PyPI version JSON
download
home_pageNone
SummaryInstall clang-tools (clang-format, clang-tidy) with pip
upload_time2024-03-27 02:58:30
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT License
keywords clang clang-tools clang-extra clang-tidy clang-format
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            clang-tools CLI
===============

**Install clang-format, clang-tidy, clang-query, and clang-apply-replacements binaries with clang-tools CLI.**

.. |latest-version| image:: https://img.shields.io/pypi/v/clang-tools
    :target: https://pypi.org/project/clang-tools/
    :alt: PyPI
.. |python-test| image:: https://github.com/cpp-linter/clang-tools-pip/actions/workflows/python-test.yml/badge.svg
    :target: https://github.com/cpp-linter/clang-tools-pip/actions/workflows/python-test.yml
    :alt: Python test
.. |codecov-badge| image:: https://codecov.io/gh/cpp-linter/clang-tools-pip/branch/main/graph/badge.svg?token=40G5ZOIRRR
    :target: https://codecov.io/gh/cpp-linter/clang-tools-pip
    :alt: codecov
.. |sonar-badge| image:: https://sonarcloud.io/api/project_badges/measure?project=cpp-linter_clang-tools-pip&metric=alert_status
    :target: https://sonarcloud.io/summary/new_code?id=cpp-linter_clang-tools-pip
    :alt: sonarcloud
.. |platfrom-badge| image:: https://img.shields.io/badge/platform-linux--64%20%7C%20win--64%20%7C%20osx--64%20-blue
    :target: https://pypi.org/project/clang-tools/
    :alt: Platfrom
.. |pypi-badge| image:: https://img.shields.io/pypi/dw/clang-tools
    :target: https://pypistats.org/packages/clang-tools
    :alt: PyPI - Downloads

|latest-version| |python-test| |codecov-badge| |sonar-badge| |platfrom-badge| |pypi-badge|

.. important::
    This package only manages binary executables (& corresponding symbolic links) that
    are installed using this package's executable script. It does not intend to change or
    modify any binary executable installed from other sources (like LLVM releases).

Features
--------

- Binaries are statically linked for improved portability.
- Binaries can be specified installed for increased flexibility.
- Binaries are checked with SHA512 checksum. This ensures:

  1. Downloads are not corrupted.
  2. Old binary builds can be updated.
- Installed binaries are symbolically linked for better cross-platform usage.
  For example (on Windows), the ``clang-tidy-13.exe`` binary executable can
  also be invoked with the symbolic link titled ``clang-tidy.exe``

  .. note::
      To create symbolic links on Windows, you must enable developer mode
      from the Windows settings under "Privacy & security" > "For developers"
      category.
- Customizable install path.

Install clang-tools CLI
-----------------------

.. tip::
    It is recommended to use this package in a virtual environment.

    .. code-block:: bash

        # create the virtual env in the working directory
        python -m venv env-name

        # to activate on Linux:
        source env-name/bin/activate

        # to activate on Windows:
        ./env-name/Scripts/activate

    This will ensure that

    1. there are no permission problems when installing the tool
    2. the installed path (for MacOS and Windows) is within the environment's
       variable ``PATH``.

Install `clang-tools` command with pip

.. code-block:: shell

    pip install clang-tools

Install `clang-tools` from git repo

.. code-block:: shell

    pip install git+https://github.com/cpp-linter/clang-tools-pip.git@main

CLI Usage
---------

For a list of supported Command Line Interface options, see
`the CLI documentation <https://cpp-linter.github.io/clang-tools-pip/cli_args.html>`_

Examples
********

Use ``clang-tools`` command to install version 13 binaries.

.. code-block:: shell

    clang-tools --install 13

Or install to a specified directory

.. code-block:: shell

    clang-tools --install 13 --directory .

Or install a specified tool, such as clang-format and clang-query version 14.

.. code-block:: shell

    clang-tools --install 14 --tool clang-format clang-query

If the installed directory is in your path, you can run the installed tools.

.. code-block:: shell

    clang-format-13 --version
    clang-format version 13.0.0

.. code-block:: shell

    clang-tidy-13 --version
    LLVM (http://llvm.org/):
      LLVM version 13.0.0
      Optimized build.
      Default target: x86_64-unknown-linux-gnu
      Host CPU: skylake

Supported versions
------------------

clang-format, clang-tidy, clang-query, clang-apply-replacements
***************************************************************
.. csv-table::
    :header: "Version", "18", "17", "16", "15", "14", "13", "12", "11", "10", "9", "8", "7"
    :stub-columns: 1

    Linux,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
    Windows,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
    macOS,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️

.. warning::
    All clang-tidy v14+ builds for MacOS are still ~1.7 GB in size.

------------

Thanks to the project
`clang-tools-static-binaries <https://github.com/muttleyxd/clang-tools-static-binaries>`_.
We now used the `fork repository <https://github.com/cpp-linter/clang-tools-static-binaries>`_
that fixed the clang-tidy v14+ Segmentation fault (core dumped). see `#56 <https://github.com/cpp-linter/clang-tools-pip/issues/56>`_ for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "clang-tools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "clang, clang-tools, clang-extra, clang-tidy, clang-format",
    "author": null,
    "author_email": "Peter Shen <xianpeng.shen@gmail.com>, Brendan Doherty <2bndy5@gmail.com>",
    "download_url": null,
    "platform": null,
    "description": "clang-tools CLI\n===============\n\n**Install clang-format, clang-tidy, clang-query, and clang-apply-replacements binaries with clang-tools CLI.**\n\n.. |latest-version| image:: https://img.shields.io/pypi/v/clang-tools\n    :target: https://pypi.org/project/clang-tools/\n    :alt: PyPI\n.. |python-test| image:: https://github.com/cpp-linter/clang-tools-pip/actions/workflows/python-test.yml/badge.svg\n    :target: https://github.com/cpp-linter/clang-tools-pip/actions/workflows/python-test.yml\n    :alt: Python test\n.. |codecov-badge| image:: https://codecov.io/gh/cpp-linter/clang-tools-pip/branch/main/graph/badge.svg?token=40G5ZOIRRR\n    :target: https://codecov.io/gh/cpp-linter/clang-tools-pip\n    :alt: codecov\n.. |sonar-badge| image:: https://sonarcloud.io/api/project_badges/measure?project=cpp-linter_clang-tools-pip&metric=alert_status\n    :target: https://sonarcloud.io/summary/new_code?id=cpp-linter_clang-tools-pip\n    :alt: sonarcloud\n.. |platfrom-badge| image:: https://img.shields.io/badge/platform-linux--64%20%7C%20win--64%20%7C%20osx--64%20-blue\n    :target: https://pypi.org/project/clang-tools/\n    :alt: Platfrom\n.. |pypi-badge| image:: https://img.shields.io/pypi/dw/clang-tools\n    :target: https://pypistats.org/packages/clang-tools\n    :alt: PyPI - Downloads\n\n|latest-version| |python-test| |codecov-badge| |sonar-badge| |platfrom-badge| |pypi-badge|\n\n.. important::\n    This package only manages binary executables (& corresponding symbolic links) that\n    are installed using this package's executable script. It does not intend to change or\n    modify any binary executable installed from other sources (like LLVM releases).\n\nFeatures\n--------\n\n- Binaries are statically linked for improved portability.\n- Binaries can be specified installed for increased flexibility.\n- Binaries are checked with SHA512 checksum. This ensures:\n\n  1. Downloads are not corrupted.\n  2. Old binary builds can be updated.\n- Installed binaries are symbolically linked for better cross-platform usage.\n  For example (on Windows), the ``clang-tidy-13.exe`` binary executable can\n  also be invoked with the symbolic link titled ``clang-tidy.exe``\n\n  .. note::\n      To create symbolic links on Windows, you must enable developer mode\n      from the Windows settings under \"Privacy & security\" > \"For developers\"\n      category.\n- Customizable install path.\n\nInstall clang-tools CLI\n-----------------------\n\n.. tip::\n    It is recommended to use this package in a virtual environment.\n\n    .. code-block:: bash\n\n        # create the virtual env in the working directory\n        python -m venv env-name\n\n        # to activate on Linux:\n        source env-name/bin/activate\n\n        # to activate on Windows:\n        ./env-name/Scripts/activate\n\n    This will ensure that\n\n    1. there are no permission problems when installing the tool\n    2. the installed path (for MacOS and Windows) is within the environment's\n       variable ``PATH``.\n\nInstall `clang-tools` command with pip\n\n.. code-block:: shell\n\n    pip install clang-tools\n\nInstall `clang-tools` from git repo\n\n.. code-block:: shell\n\n    pip install git+https://github.com/cpp-linter/clang-tools-pip.git@main\n\nCLI Usage\n---------\n\nFor a list of supported Command Line Interface options, see\n`the CLI documentation <https://cpp-linter.github.io/clang-tools-pip/cli_args.html>`_\n\nExamples\n********\n\nUse ``clang-tools`` command to install version 13 binaries.\n\n.. code-block:: shell\n\n    clang-tools --install 13\n\nOr install to a specified directory\n\n.. code-block:: shell\n\n    clang-tools --install 13 --directory .\n\nOr install a specified tool, such as clang-format and clang-query version 14.\n\n.. code-block:: shell\n\n    clang-tools --install 14 --tool clang-format clang-query\n\nIf the installed directory is in your path, you can run the installed tools.\n\n.. code-block:: shell\n\n    clang-format-13 --version\n    clang-format version 13.0.0\n\n.. code-block:: shell\n\n    clang-tidy-13 --version\n    LLVM (http://llvm.org/):\n      LLVM version 13.0.0\n      Optimized build.\n      Default target: x86_64-unknown-linux-gnu\n      Host CPU: skylake\n\nSupported versions\n------------------\n\nclang-format, clang-tidy, clang-query, clang-apply-replacements\n***************************************************************\n.. csv-table::\n    :header: \"Version\", \"18\", \"17\", \"16\", \"15\", \"14\", \"13\", \"12\", \"11\", \"10\", \"9\", \"8\", \"7\"\n    :stub-columns: 1\n\n    Linux,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f\n    Windows,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f\n    macOS,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f,\u2714\ufe0f\n\n.. warning::\n    All clang-tidy v14+ builds for MacOS are still ~1.7 GB in size.\n\n------------\n\nThanks to the project\n`clang-tools-static-binaries <https://github.com/muttleyxd/clang-tools-static-binaries>`_.\nWe now used the `fork repository <https://github.com/cpp-linter/clang-tools-static-binaries>`_\nthat fixed the clang-tidy v14+ Segmentation fault (core dumped). see `#56 <https://github.com/cpp-linter/clang-tools-pip/issues/56>`_ for details.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Install clang-tools (clang-format, clang-tidy) with pip",
    "version": "0.12.1",
    "project_urls": {
        "source": "https://github.com/cpp-linter/clang-tools-pip",
        "tracker": "https://github.com/cpp-linter/clang-tools-pip/issues"
    },
    "split_keywords": [
        "clang",
        " clang-tools",
        " clang-extra",
        " clang-tidy",
        " clang-format"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c5b8039ea96115fa9792a28d88860bda5eba5b1304ec41332c0559c18bbe180f",
                "md5": "4dca11dc45d396b16b8512264eb3b92c",
                "sha256": "695d3b57ac852995410b5887358d9885e245c0eb3bc2f0b67e761ec886de5633"
            },
            "downloads": -1,
            "filename": "clang_tools-0.12.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4dca11dc45d396b16b8512264eb3b92c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10533,
            "upload_time": "2024-03-27T02:58:30",
            "upload_time_iso_8601": "2024-03-27T02:58:30.321008Z",
            "url": "https://files.pythonhosted.org/packages/c5/b8/039ea96115fa9792a28d88860bda5eba5b1304ec41332c0559c18bbe180f/clang_tools-0.12.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-27 02:58:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cpp-linter",
    "github_project": "clang-tools-pip",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "clang-tools"
}
        
Elapsed time: 0.21513s