Skip to main content

Opinionated code formatter for C++ code.

Project description

WFormat

Opinionated code formatter for C++ code.

Availability

limit: only support Format Document in IDEs for now

Visual Studio Code

  • win-x64
  • win-arm64
  • macos
  • linux-64
  • linux-arm64

Visual Studio

  • win-x64
  • win-arm64

XCode

  • macos

Python Package Index(PyPI)

  • win-x64
  • win-arm64
  • macos
  • linux-64
  • linux-arm64

Tutorials

Use Visual Studio Code Extension

Install wformat from extension market

In any C++ file, Press ctrl + alt + P to bring up the command menu

Type Format Document With... select Config Default Formatter... pick wformat

Next time you call Format Document, vscode will use wformat

Use Visual Studio Extension

Install wformat from extension market

By default, you can only click Run WFormat in your Right Click Menu to format on the file

You can find wformat.General(or search wformat) in Tools > Options menu

By change Override default formatter to True, you can use Format Document(ctrl + K, ctrl + D) with wformat instead

Use as console app from Python Package Index (PyPI)

Run pip install wformat

Run wformat or wformat -h to access the docs

> wformat
overview: Opinionated code formatter for C++ code

usage: wformat [-h] [-a] [-d DIR] [-m] [-s] [-c COMMITS] [--check] [--serial] [--ls] [--stdin] [--serve] [paths ...]

tutorials:

format all under the current folder: (-a/--all)
   wformat -a
   → Recursively formats all C/C++ files under the current folder.

format all under the given folder: (-d/--dir)
   wformat -d path/to/folder
   → Recursively formats all C/C++ files under path/to/folder.

format modified: (-m/--modified)
   wformat -m
   → Formats the modified files(not including staged) in your Git repository.

format staged: (-s/--staged)
   wformat -s
   → Formats the staged files in your Git repository.

format last N commits: (-c/--commits)
   wformat -c N
   → Formats files from last N commits in your Git repository.

positional arguments:
  paths                 All file paths to be formatted

options:
  -h, --help            show this help message and exit
  -a, --all             Run auto format on all files which is child of current path.
  -d, --dir DIR         Run on file under which directory.
  -m, --modified        Run auto format on modified but not staged files in git.
  -s, --staged          Run auto format on staged files in git.
  -c, --commits COMMITS
                        Run auto format on all files modified in the last N commits.
  --check               Only check the format correctness without changing files.
  --serial              Run in serial mode or not. By default, script will use multi threading.
  --ls                  List all the files that matched given criteria to process and quit without processing them.
  --stdin               Read code from stdin and write formatted code to stdout (no banners).
  --serve               Run a persistent stdio server (JSON Lines) for IDE integration.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

wformat-0.1.1-py3-none-win_amd64.whl (9.7 MB view details)

Uploaded Python 3Windows x86-64

wformat-0.1.1-py3-none-win32.whl (9.7 MB view details)

Uploaded Python 3Windows x86

wformat-0.1.1-py3-none-macosx_15_0_arm64.whl (2.6 MB view details)

Uploaded Python 3macOS 15.0+ ARM64

File details

Details for the file wformat-0.1.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: wformat-0.1.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 9.7 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for wformat-0.1.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ab1ba93af9d73a40f022512353b1a96b77ac745d15998986bd35723ffe2ef613
MD5 54ec1fd010358e7667ac7d2d2537e161
BLAKE2b-256 fa7d32d661198d507b01cba56c6c578e24b9ba33770783ad94b5596f55b5f332

See more details on using hashes here.

Provenance

The following attestation bundles were made for wformat-0.1.1-py3-none-win_amd64.whl:

Publisher: publish-to-pypi.yml on Ziwei-Wei/wformat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wformat-0.1.1-py3-none-win32.whl.

File metadata

  • Download URL: wformat-0.1.1-py3-none-win32.whl
  • Upload date:
  • Size: 9.7 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for wformat-0.1.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 a32b1f94a3d0390c4ac1557ac0cdf4cca7de1b13fabebfde4505a05195940308
MD5 aa3e107d17fd4463b95e8b22cf6dc28b
BLAKE2b-256 c4f7020e74a1036e92d185d7ca1febd7e1c30013b4ca5b138f8942fc09432323

See more details on using hashes here.

Provenance

The following attestation bundles were made for wformat-0.1.1-py3-none-win32.whl:

Publisher: publish-to-pypi.yml on Ziwei-Wei/wformat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wformat-0.1.1-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for wformat-0.1.1-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bcfdac3908c24378490d2c3111ffd6164ab20c1604f73704ef870707130cf42a
MD5 14ab109bd586eddbcacd4e7e7e9e3597
BLAKE2b-256 9af3f209a39da8c10885f96db81a48668ce583f042ead9301287965aad1f611c

See more details on using hashes here.

Provenance

The following attestation bundles were made for wformat-0.1.1-py3-none-macosx_15_0_arm64.whl:

Publisher: publish-to-pypi.yml on Ziwei-Wei/wformat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page