Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

clang format

Sergii Dymchenko edited this pageMar 22, 2022 ·4 revisions

If you arrived here due to a lint error, running the command given in the message will fix your problem.

This wiki covers how to set up clang-format as part of your workflow.

  1. Addtools/git-clang-format to your$PATH. This is a modified version of the default git integration that fetches a pinned binary guaranteed to work with the CI and other PyTorch developers. Once its added to your$PATH, runninggit clang-format will invoke it.
  2. To ensure your changes are always formatted, you can addgit clang-format to your a pre-commit hook. PyTorch provides a pre-commit hook (instructions) that runs our standard linters, or you can make your own that just format:
# run in pytorch rootcat <<\EOF > .git/hooks/pre-commit#!/bin/bashset -egit clang-formatEOFchmod 755 .git/hooks/pre-commit

I would love to contribute to PyTorch!

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp