Skip to content

Commit 173fcea

Browse files
authored
Remove unnecessary config files & update others (#15)
* No longer need .dir-locals.el & .vimrc With the latest changes to `.editorconfig` (which were arrived at through experiences in another project), the settings that were in `.dir-locals.el` and `.vimrc` are no longer needed because they're captured by `.editorconfig`. * Add back max_line_length setting After more discussion, the conclusion is that despite the issues with `max_line_length`, it is handled as expected in the editors that many people have been using. * Adjust line length to 80 based on current project conventions
1 parent 55e234b commit 173fcea

4 files changed

Lines changed: 11 additions & 60 deletions

File tree

.dir-locals.el

Lines changed: 0 additions & 4 deletions
This file was deleted.

.editorconfig

Lines changed: 8 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,10 @@
1515
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1616
# Common editor configurations for this project.
1717
#
18-
# EditorConfig defines a file format for specifying some common coding style
19-
# parameters. Many IDEs and editors read .editorconfig files, either natively
20-
# or via plugins. A few formatters also read .editorconfig; shfmt and Prettier
21-
# are two examples (as of early 2025).
22-
#
18+
# EditorConfig is a file format for specifying some common style parameters.
19+
# Many IDEs & editors read .editorconfig files, either natively or via plugins.
2320
# We mostly follow Google's style guides (https://google.github.io/styleguide/)
24-
# with very few deviations.
25-
#
26-
# Miscellaneous notes:
27-
#
28-
# - The EditorConfig property `max_line_length` is not set here because its
29-
# intended behavior is poorly specified. (See the discussion in the comments
30-
# at https://github.com/editorconfig/editorconfig/issues/387) It *would* have
31-
# been desirable to define a project convention for the line width here, but
32-
# we must instead use editor-specific configuration files to do that.
33-
#
34-
# - With one known exception (shfmt), `.editorconfig` files are not read by
35-
# linters or formatters, which means the project needs separate config files
36-
# for those tools.
21+
# with only a few deviations for line length and indentation in some files.
3722
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3823

3924
root = true
@@ -43,51 +28,28 @@ charset = utf-8
4328
indent_style = space
4429
insert_final_newline = true
4530
spelling_language = en-US
46-
# It would be preferable not to set tab_width, but some EditorConfig plugins
47-
# (e.g., Emacs's) set it equal to indent_size if it's not set otherwise.
48-
tab_width = 8
49-
# Trailing whitespace on lines is almost always noise. An exception is in
50-
# Markdown, where two spaces = line break; however, that's such a foot-gun in
51-
# practice that we avoid it. So, it's okay to set this next value globally.
5231
trim_trailing_whitespace = true
32+
max_line_length = 80
5333

54-
[{BUILD,*.BUILD,*.bzl,*.bazel}]
34+
[{BUILD,*.BUILD,*.bzl,*.bazel,.bazelrc}]
5535
# Google doesn't have a style guideline for Bazel files. Most people use 4.
5636
indent_size = 4
5737

5838
[{*.cc,*.h}]
59-
# This matches Google style guidelines.
60-
indent_size = 2
61-
62-
[{*.ts,*.js}]
63-
# This matches Google style guidelines.
39+
# Google style guidelines use 2.
6440
indent_size = 2
6541

6642
[*.json]
6743
# Not stated explicitly in Google's guidelines, but the examples use 2.
6844
indent_size = 2
6945

7046
[*.py]
71-
# This matches Google style guidelines.
47+
# Google style guidelines use 4.
7248
indent_size = 4
7349

74-
[*.rst]
75-
# Google doesn't have a style guideline for reStructuredText. Many people use 3.
76-
indent_size = 3
77-
7850
[*.sh]
79-
# This matches Google style guidelines.
51+
# Google style guidelines use 2.
8052
indent_size = 2
81-
# The following are used by shfmt. These bring it closer to Google's style.
82-
binary_next_line = true
83-
shell_variant = bash
84-
space_redirects = true
85-
switch_case_indent = true
86-
87-
# If this repository has a "third_party" directory, ignore it entirely.
88-
# Note: shfmt also respects this if you run it with --appply-ignore.
89-
[third_party/**]
90-
ignore = true
9153

9254
[{*.yaml,*.yml}]
9355
# Google doesn't have style guidelines for YAML. Most people use indent = 2.

.markdownlintrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
// Google style exempts some constructs from the line-length limit:
6363
// https://google.github.io/styleguide/docguide/style.html#exceptions
6464
"line-length": {
65-
"line_length": 100,
66-
"code_block_line_length": 100,
67-
"heading_line_length": 100,
65+
"line_length": 80,
66+
"code_block_line_length": 80,
67+
"heading_line_length": 80,
6868
"code_blocks": false,
6969
"headings": false,
7070
"tables": false

.vimrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)