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
usage: wformat [-h] [-d DIR] [-a BRANCH] [-m] [-s] [-c COMMITS] [--all] [--check] [--serial] [--ls] [--stdin] [--serve] [-v] [paths ...]

tutorials:

format all under the current folder: (-a/--against)
   wformat -a origin/develop
   → Recursively all C/C++ files diff with branch origin/develop.

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
  -d, --dir DIR         Run on file under which directory.
  -a, --against BRANCH  Run auto format on files changed compared to BRANCH (git diff BRANCH...HEAD).
  -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.
  --all                 Run auto format on all files which is child of current path.
  --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.
  -v, --version         Show wformat version and exit.

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.2-py3-none-win_amd64.whl (9.7 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3Windows x86

wformat-0.1.2-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.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: wformat-0.1.2-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.13.7

File hashes

Hashes for wformat-0.1.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3cb6cd91617be9b08701fa8597bfbda48d16179a57f63524030caeed123fe197
MD5 2abc73d66eda265918ff056ff0e7372b
BLAKE2b-256 42b3890ffe5f3f1d60ea3e6d82d1edd799f2eb9df24ad845d6a14ea9108c7913

See more details on using hashes here.

Provenance

The following attestation bundles were made for wformat-0.1.2-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.2-py3-none-win32.whl.

File metadata

  • Download URL: wformat-0.1.2-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.13.7

File hashes

Hashes for wformat-0.1.2-py3-none-win32.whl
Algorithm Hash digest
SHA256 0398d54414ab6b772a801e783f2ca749598472073a7b43228a689349608401b7
MD5 f86f562fb32a55c7fbe9e45d1834c6a5
BLAKE2b-256 b80b5e346c9498a4ef2e80ffe1f4d80494b60d866ba2c47ccf9de77772ef3bcd

See more details on using hashes here.

Provenance

The following attestation bundles were made for wformat-0.1.2-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.2-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for wformat-0.1.2-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 da34bc4190346c0415f4dfb40cfca1f6b35632ca5471e506f99dd30262c15c4a
MD5 96e6bfa0e68e1938302eabb3d30d12cd
BLAKE2b-256 68b156208644f92f6cb0676438602904124593d470186947a6283f66f1d29b45

See more details on using hashes here.

Provenance

The following attestation bundles were made for wformat-0.1.2-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