Applying black formatting

- Fixing flake8 configuration to agree with black
- Adding black validation check to github actions
This commit is contained in:
Jacob Alexander
2021-10-01 11:00:22 -07:00
parent 5dade41aeb
commit 6e7fffd7de
51 changed files with 2536 additions and 1837 deletions

View File

@@ -11,7 +11,12 @@ def parse_args():
parser.add_argument("command")
parser.add_argument("schema_file")
parser.add_argument("struct_name")
parser.add_argument("-d", "--defaults", help="include default values in json output", action="store_true")
parser.add_argument(
"-d",
"--defaults",
help="include default values in json output",
action="store_true",
)
return parser.parse_args()
@@ -41,9 +46,11 @@ def main():
command = args.command
kwargs = vars(args)
del kwargs['command']
del kwargs["command"]
globals()[command](**kwargs) # hacky way to get defined functions, and call function with name=command
globals()[command](
**kwargs
) # hacky way to get defined functions, and call function with name=command
main()

View File

@@ -3,7 +3,10 @@ import os
import sys
import capnp
capnp.add_import_hook([os.getcwd(), "/usr/local/include/"]) # change this to be auto-detected?
capnp.add_import_hook(
[os.getcwd(), "/usr/local/include/"]
) # change this to be auto-detected?
import test_capnp # noqa: E402
@@ -20,7 +23,7 @@ def encode(name):
print(message.to_bytes())
if sys.argv[1] == 'decode':
if sys.argv[1] == "decode":
decode(sys.argv[2])
else:
encode(sys.argv[2])