misc: Run pre-commit run on all files in repo

The following command was run:

```
pre-commit run --all-files
```

This ensures all the files in the repository are formatted to pass our
checks.

Change-Id: Ia2fe3529a50ad925d1076a612d60a4280adc40de
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62572
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Bobby R. Bruce
2022-08-22 12:34:19 -07:00
committed by Bobby Bruce
parent 64add0e04d
commit 2bc5a8b71a
181 changed files with 1445 additions and 1229 deletions

View File

@@ -54,9 +54,9 @@ from .file_types import lang_type
def safefix(fix_func):
""" Decorator for the fix functions of the Verifier class.
This function wraps the fix function and creates a backup file
just in case there is an error.
"""Decorator for the fix functions of the Verifier class.
This function wraps the fix function and creates a backup file
just in case there is an error.
"""
def safefix_wrapper(*args, **kwargs):
@@ -474,29 +474,29 @@ class BoolCompare(LineVerifier):
class StructureBraces(LineVerifier):
""" Check if the opening braces of structures are not on the same line of
the structure name. This includes classes, structs, enums and unions.
"""Check if the opening braces of structures are not on the same line of
the structure name. This includes classes, structs, enums and unions.
This verifier matches lines starting in optional indent, followed by
an optional typedef and the structure's keyword, followed by any
character until the first opening brace is seen. Any extra characters
after the opening brace are saved for a recursive check, if needed.
This verifier matches lines starting in optional indent, followed by
an optional typedef and the structure's keyword, followed by any
character until the first opening brace is seen. Any extra characters
after the opening brace are saved for a recursive check, if needed.
This fixes, for example:
1) "struct A {"
2) "enum{"
3) " class B { // This is a class"
4) "union { struct C {"
to:
1) "struct A\n{"
2) "enum\n{"
3) " class B\n {\n // This is a class"
4) "union\n{\n struct C\n {"
This fixes, for example:
1) "struct A {"
2) "enum{"
3) " class B { // This is a class"
4) "union { struct C {"
to:
1) "struct A\n{"
2) "enum\n{"
3) " class B\n {\n // This is a class"
4) "union\n{\n struct C\n {"
@todo Make this work for multi-line structure declarations. e.g.,
@todo Make this work for multi-line structure declarations. e.g.,
class MultiLineClass
: public BaseClass {
class MultiLineClass
: public BaseClass {
"""
languages = set(("C", "C++"))