Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #205

Merged
merged 2 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
hooks:
- id: flake8
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
rev: v3.0.0
hooks:
- id: pyupgrade
- repo: https://github.com/pycqa/isort
Expand All @@ -23,6 +23,6 @@ repos:
- id: isort
name: isort (python)
- repo: https://github.com/psf/black
rev: 22.8.0
rev: 22.10.0
hooks:
- id: black
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# Generate the agglomerated changes (from the CHANGELOG) between fortls
# and the fortran-language-server project
with open("../CHANGELOG.md", "r") as f:
with open("../CHANGELOG.md") as f:
lns = f.readlines()

lns = lns[0 : lns.index("## 1.12.0\n")]
Expand Down
4 changes: 1 addition & 3 deletions fortls/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import json
import os
import pprint
Expand Down Expand Up @@ -467,7 +465,7 @@ def debug_server_parser(args):
config_exists = os.path.isfile(config_path)
if config_exists:
try:
with open(config_path, "r") as fhandle:
with open(config_path) as fhandle:
config_dict = json.load(fhandle)
pp_suffixes = config_dict.get("pp_suffixes", None)
pp_defs = config_dict.get("pp_defs", {})
Expand Down
8 changes: 4 additions & 4 deletions fortls/intrinsics.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def add_children(json_obj, fort_obj):
os.path.dirname(os.path.abspath(__file__)), "statements.json"
)
statements = {"var_def": [], "int_stmnts": []}
with open(json_file, "r", encoding="utf-8") as fid:
with open(json_file, encoding="utf-8") as fid:
intrin_file = json.load(fid)
for key in statements:
for name, json_obj in sorted(intrin_file[key].items()):
Expand All @@ -151,7 +151,7 @@ def add_children(json_obj, fort_obj):
os.path.dirname(os.path.abspath(__file__)), "keywords.json"
)
keywords = {"var_def": [], "arg": [], "type_mem": [], "vis": [], "param": []}
with open(json_file, "r", encoding="utf-8") as fid:
with open(json_file, encoding="utf-8") as fid:
intrin_file = json.load(fid)
for key in keywords:
for name, json_obj in sorted(intrin_file[key].items()):
Expand All @@ -162,7 +162,7 @@ def add_children(json_obj, fort_obj):
os.path.dirname(os.path.abspath(__file__)), "intrinsic_funs.json"
)
int_funs = []
with open(json_file, "r", encoding="utf-8") as fid:
with open(json_file, encoding="utf-8") as fid:
intrin_file = json.load(fid)
for name, json_obj in sorted(intrin_file.items()):
int_funs.append(create_int_object(name, json_obj, json_obj["type"]))
Expand All @@ -173,7 +173,7 @@ def add_children(json_obj, fort_obj):
os.path.dirname(os.path.abspath(__file__)), "intrinsic_mods.json"
)
int_mods = []
with open(json_file, "r", encoding="utf-8") as fid:
with open(json_file, encoding="utf-8") as fid:
intrin_file = json.load(fid)
for key, json_obj in intrin_file.items():
fort_obj = create_object(json_obj)
Expand Down
2 changes: 1 addition & 1 deletion fortls/langserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ def _load_config_file(self) -> None:
break

try:
with open(config_path, "r") as jsonfile:
with open(config_path) as jsonfile:
config_dict = json5.load(jsonfile)

# Include and Exclude directories
Expand Down
2 changes: 1 addition & 1 deletion fortls/parse_fortran.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ def load_from_disk(self) -> tuple[str | None, bool | None]:
"""
contents: str
try:
with open(self.path, "r", encoding="utf-8", errors="replace") as f:
with open(self.path, encoding="utf-8", errors="replace") as f:
contents = re.sub(r"\t", r" ", f.read())
except OSError:
return "Could not read/decode file", None
Expand Down