diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 29d2de9f..41cae9da 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -10,19 +10,19 @@ repos: - id: check-added-large-files args: ['--maxkb=2000'] - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 7.0.0 hooks: - id: flake8 - repo: https://github.com/asottile/pyupgrade - rev: v3.9.0 + rev: v3.15.2 hooks: - id: pyupgrade - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort name: isort (python) - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 24.4.2 hooks: - id: black diff --git a/fortls/parsers/internal/ast.py b/fortls/parsers/internal/ast.py index d34d7a49..0780ad6f 100644 --- a/fortls/parsers/internal/ast.py +++ b/fortls/parsers/internal/ast.py @@ -192,9 +192,9 @@ def get_scopes(self, line_number: int = None): scope_list = [] for scope in self.scope_list: if (line_number >= scope.sline) and (line_number <= scope.eline): - if type(scope.parent) == Interface: + if type(scope.parent) is Interface: for use_stmnt in scope.use: - if type(use_stmnt) != Import: + if type(use_stmnt) is not Import: continue # Exclude the parent and all other scopes if use_stmnt.import_type == ImportTypes.NONE: diff --git a/fortls/parsers/internal/scope.py b/fortls/parsers/internal/scope.py index a5d83f3a..7592729a 100644 --- a/fortls/parsers/internal/scope.py +++ b/fortls/parsers/internal/scope.py @@ -216,7 +216,7 @@ def check_use(self, obj_tree): last_use_line = -1 for use_stmnt in self.use: last_use_line = max(last_use_line, use_stmnt.line_number) - if type(use_stmnt) == Import: + if type(use_stmnt) is Import: if (self.parent is None) or ( self.parent.get_type() != INTERFACE_TYPE_ID ):