Skip to content

Commit

Permalink
Added auto-formatting configuration for Python code.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 539960450
  • Loading branch information
ondrasej committed Jun 13, 2023
1 parent 5ea6cc3 commit 85318bb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CONTRIBUTING
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,25 @@ the one above, the

## Code formatting

### C++ code

All C++ code in this repository is formatted using `clang-format` in the Google
style. Formatting a file can either be done by your IDE through `clangd`
integration or manually by directly calling `clang-format`:

```bash
clang-format -i <path to .cc file>
```

### Python code

All Python code in this repository is formatted using
[Pyink](https://github.com/google/pyink) with settings in `pyproject.toml`. To
format the code, run:

```bash
pyink .
```

See the Pyink and [Black](https://github.com/psf/black) documentation for IDE
integrations.
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tool.pyink]
line-length = 80
preview = true
pyink-indentation = 2
pyink-use-majority-quotes = true

0 comments on commit 85318bb

Please sign in to comment.