Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiyuan Chen <[email protected]>
  • Loading branch information
ZhiyuanChen committed Mar 16, 2023
1 parent 17d712f commit be89036
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LICENSES/LICENSE.BSD4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 4-Clause License

Copyright (c) [year], [fullname]
Copyright (c) 2021-2023, DanLing Contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ DanLing is multi-licensed under the following licenses:
- Apache 2.0
- BSD 2-Clause
- BSD 3-Clause
- BSD 4-Clause

You can choose any (one or more) of them if you use this work.

`SPDX-License-Identifier: Unlicense OR GPL-2.0-or-later OR MIT OR Apache-2.0 OR BSD-2-Clause OR BSD-3-Clause`
`SPDX-License-Identifier: Unlicense OR GPL-2.0-or-later OR MIT OR Apache-2.0 OR BSD-2-Clause OR BSD-3-Clause OR BSD-4-Clause`
2 changes: 1 addition & 1 deletion danling/utils/basex.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def encode(self, decimal: int) -> str:

def decode(self, string: str) -> int:
decoded = 0
for i, a in enumerate(reversed(string)):
for i, a in enumerate(reversed(string)): # pylint: disable=C0103
decoded += (self.num_alphabets**i) * self.alphabet_dict[a]
return decoded

Expand Down
4 changes: 2 additions & 2 deletions danling/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ def save(obj: Any, file: PathStr, *args: List[Any], **kwargs: Dict[str, Any]) ->
raise NotImplementedError(f"Trying to save {obj} to {file!r} but is not supported")
elif extension in JSON:
if isinstance(obj, FlatDict):
obj = obj.json(file)
obj.json(file)
else:
with open(file, "w") as fp: # pylint: disable=W1514, C0103
json.dump(obj, fp, *args, **kwargs) # type: ignore
elif extension in YAML:
if isinstance(obj, FlatDict):
obj = obj.yaml(file)
obj.yaml(file)
else:
with open(file, "w") as fp: # pylint: disable=W1514, C0103
yaml.dump(obj, fp, *args, **kwargs) # type: ignore
Expand Down

0 comments on commit be89036

Please sign in to comment.