Skip to content

Commit 51e21a8

Browse files
authored
Add .editorconfig file (#864)
This adds settings based on some common-sense values and the TensorFlow Quantum project's current conventions, such as line length and use of spaces instead of tabs. The settings match the corresponding ones in `.pylintrc`.
2 parents 6b60bde + bb5ccda commit 51e21a8

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.editorconfig

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2025 The TensorFlow Quantum Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
# Common editor configurations for this project.
17+
#
18+
# EditorConfig is a file format for specifying some common style parameters.
19+
# Many IDEs & editors read .editorconfig files, either natively or via plugins.
20+
# We mostly follow Google's style guides (https://google.github.io/styleguide/)
21+
# with only a few deviations for line length and indentation in some files.
22+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23+
24+
root = true
25+
26+
# IMPORTANT: some of the other config files (.markdownlintrc, .jsonlintrc.yaml,
27+
# etc.) also have settings for indent and line length. When making changes to
28+
# this file, make sure to update the other files to match.
29+
30+
[*]
31+
charset = utf-8
32+
indent_style = space
33+
insert_final_newline = true
34+
spelling_language = en-US
35+
trim_trailing_whitespace = true
36+
max_line_length = 80
37+
38+
[{BUILD,*.BUILD,*.bzl,*.bazel,.bazelrc}]
39+
indent_size = 4
40+
41+
[{*.cc,*.h}]
42+
indent_size = 2
43+
44+
[*.json]
45+
indent_size = 2
46+
47+
[*.py]
48+
indent_size = 4
49+
50+
[*.sh]
51+
indent_size = 4
52+
53+
[*.yml,*.yaml]
54+
indent_size = 2

0 commit comments

Comments
 (0)