Skip to content

Commit 78a60aa

Browse files
committed
Rename .styleguide configs to .wpiformat to match tool name
1 parent d3a2225 commit 78a60aa

File tree

11 files changed

+24
-24
lines changed

11 files changed

+24
-24
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ jobs:
106106
rm -rf branch-test
107107
mkdir branch-test && cd branch-test && git init
108108
git checkout -b master
109-
touch .styleguide
110-
git add .styleguide && git commit -q -m "Initial commit"
109+
touch .wpiformat
110+
git add .wpiformat && git commit -q -m "Initial commit"
111111
wpiformat
112112
113113
# Verify wpiformat reports success if "main" exists
@@ -117,8 +117,8 @@ jobs:
117117
rm -rf branch-test
118118
mkdir branch-test && cd branch-test && git init
119119
git checkout -b main
120-
touch .styleguide
121-
git add .styleguide && git commit -q -m "Initial commit"
120+
touch .wpiformat
121+
git add .wpiformat && git commit -q -m "Initial commit"
122122
wpiformat
123123
124124
- name: Delete branch-test folder

.styleguide renamed to .wpiformat

File renamed without changes.
File renamed without changes.

wpiformat/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ pip install wpiformat
2020

2121
## Project Setup
2222

23-
To use these tools with a new project, copy `.styleguide`, and `.styleguide-license` from the examples folder into the project and create a new `.clang-format` file based on the desired C/C++ style.
23+
To use these tools with a new project, copy `.wpiformat`, and `.wpiformat-license` from the examples folder into the project and create a new `.clang-format` file based on the desired C/C++ style.
2424

2525
Note: Since wpiformat already handles include ordering, it is recommended to use `SortIncludes: false` in `.clang-format`.
2626

27-
## .styleguide
27+
## .wpiformat
2828

29-
wpiformat checks the current directory for the `.styleguide` file. If one doesn't exist, all parent directories are tried as well. This file contains groups of filename regular expressions.
29+
wpiformat checks the current directory for the `.wpiformat` file. If one doesn't exist, all parent directories are tried as well. This file contains groups of filename regular expressions.
3030
```
3131
groupName {
3232
regex_here
@@ -36,7 +36,7 @@ The regexes are matched using [re.search()](https://docs.python.org/3/library/re
3636

3737
Empty config groups can be omitted. Directory separators must be "/", not "\\". During processing, they will be replaced internally with an os.sep that is automatically escaped for regexes.
3838

39-
See the `.styleguide` file in the docs/examples directory for all possible groups.
39+
See the `.wpiformat` file in the docs/examples directory for all possible groups.
4040

4141
### Specifying C/C++ files to format
4242

@@ -87,17 +87,17 @@ The following groups correspond to the header groups in the style guide. If a he
8787

8888
Appending a `// NOLINT` comment to a header include to prevent wpiformat's header include sorter from modifying it and to maintain its relative ordering with other header includes. This will, in effect, treat it as a barrier across which no header includes will be moved. Header includes on each side of the barrier will still be sorted as normal.
8989

90-
## .styleguide-license
90+
## .wpiformat-license
9191

92-
This file contains the license header template. It should contain `Copyright (c)` followed by the company name and the string `{year}`. See the `.styleguide-license` file in the docs/examples directory.
92+
This file contains the license header template. It should contain `Copyright (c)` followed by the company name and the string `{year}`. See the `.wpiformat-license` file in the docs/examples directory.
9393

94-
wpiformat checks the currently processed file's directory for a `.styleguide` file first and traverses up the directory tree if one isn't found. This allows templates which are closer to the processed file to override a project's main template.
94+
wpiformat checks the currently processed file's directory for a `.wpiformat` file first and traverses up the directory tree if one isn't found. This allows templates which are closer to the processed file to override a project's main template.
9595

9696
### License header semantics
9797

9898
The license header is always at the beginning of the file and ends after two newlines. If there isn't one, or it doesn't contain the required copyright contents, wpiformat inserts a new one containing the current year.
9999

100-
### `.styleguide-license` special variables
100+
### `.wpiformat-license` special variables
101101

102102
`{year}` is replaced with a year range from the earliest copyright year in the file to the current year. If the earliest year is the current year, only that year will be written.
103103

File renamed without changes.

wpiformat/test/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
def test_config():
7-
config_file = Config(os.path.abspath(os.getcwd()), ".styleguide")
7+
config_file = Config(os.path.abspath(os.getcwd()), ".wpiformat")
88
assert config_file.is_modifiable_file(
99
"." + os.sep + "wpiformat" + os.sep + "javaguidelink.png"
1010
)

wpiformat/test/test_licenseupdate.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,20 +307,20 @@ def test_licenseupdate():
307307
)
308308

309309
# Ensure excluded files won't be processed
310-
config_file = Config(os.path.abspath(os.getcwd()), ".styleguide")
310+
config_file = Config(os.path.abspath(os.getcwd()), ".wpiformat")
311311
assert not task.should_process_file(config_file, "./Excluded.h")
312312

313313
# Create git repo to test license years for commits
314314
with OpenTemporaryDirectory():
315315
subprocess.run(["git", "init", "-q"])
316316

317317
# Add base files
318-
with open(".styleguide-license", "w") as file:
318+
with open(".wpiformat-license", "w") as file:
319319
file.write("// Copyright (c) {year}")
320-
with open(".styleguide", "w") as file:
320+
with open(".wpiformat", "w") as file:
321321
file.write("cppSrcFileInclude {\n" + r"\.cpp$")
322-
subprocess.run(["git", "add", ".styleguide-license"])
323-
subprocess.run(["git", "add", ".styleguide"])
322+
subprocess.run(["git", "add", ".wpiformat-license"])
323+
subprocess.run(["git", "add", ".wpiformat"])
324324
subprocess.run(["git", "commit", "-q", "-m", '"Initial commit"'])
325325

326326
# Add file with commit date of last year and range through this year

wpiformat/test/test_tasktest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def run(self, output_type):
6868
"""
6969
assert len(self.inputs) == len(self.outputs)
7070

71-
config_file = Config(os.path.abspath(os.getcwd()), ".styleguide")
71+
config_file = Config(os.path.abspath(os.getcwd()), ".wpiformat")
7272

7373
for i in range(len(self.inputs)):
7474
if self.task.should_process_file(config_file, self.inputs[i][0]):

wpiformat/wpiformat/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def proc_pipeline(name):
8787
Keyword arguments:
8888
name -- file name string
8989
"""
90-
config_file = Config(os.path.dirname(name), ".styleguide")
90+
config_file = Config(os.path.dirname(name), ".wpiformat")
9191
if verbose1 or verbose2:
9292
with print_lock:
9393
print("Processing", name)
@@ -129,7 +129,7 @@ def proc_standalone(name):
129129
Keyword arguments:
130130
name -- file name string
131131
"""
132-
config_file = Config(os.path.dirname(name), ".styleguide")
132+
config_file = Config(os.path.dirname(name), ".wpiformat")
133133
if verbose2:
134134
with print_lock:
135135
print("Processing", name)
@@ -179,7 +179,7 @@ def proc_batch(files):
179179
for subtask in task_pipeline:
180180
work = []
181181
for name in files:
182-
config_file = Config(os.path.dirname(name), ".styleguide")
182+
config_file = Config(os.path.dirname(name), ".wpiformat")
183183
if subtask.should_process_file(config_file, name):
184184
work.append(name)
185185

@@ -480,7 +480,7 @@ def main():
480480
# Don't run tasks on modifiable or generated files
481481
work = []
482482
for name in files:
483-
config_file = Config(os.path.dirname(name), ".styleguide")
483+
config_file = Config(os.path.dirname(name), ".wpiformat")
484484

485485
if config_file.is_modifiable_file(name):
486486
continue

0 commit comments

Comments
 (0)