Skip to content

Commit

Permalink
🎨 Simplify code
Browse files Browse the repository at this point in the history
Remove unused pre-commit-hooks
  • Loading branch information
Freed-Wu committed Oct 27, 2023
1 parent 636b8ae commit b038136
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 38 deletions.
13 changes: 0 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,6 @@ repos:
- -cpyproject.toml
additional_dependencies:
- tomli
- repo: https://github.com/cmake-lint/cmake-lint
rev: 1.4.2
hooks:
- id: cmakelint
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
additional_dependencies:
- pyyaml
- id: cmake-lint
additional_dependencies:
- pyyaml

ci:
skip:
Expand Down
37 changes: 12 additions & 25 deletions src/autotools_language_server/finders.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
===========
"""
import os
from dataclasses import dataclass

from lsprotocol.types import DiagnosticSeverity
from tree_sitter import Node, Tree
Expand All @@ -10,23 +11,12 @@
from tree_sitter_lsp.finders import ErrorFinder, MissingFinder, RepeatedFinder


@dataclass
class InvalidPathFinder(Finder):
r"""Invalidpathfinder."""

def __init__(
self,
message: str = "{{uni.get_text()}}: no such file",
severity: DiagnosticSeverity = DiagnosticSeverity.Error,
) -> None:
r"""Init.
:param message:
:type message: str
:param severity:
:type severity: DiagnosticSeverity
:rtype: None
"""
super().__init__(message, severity)
message: str = "{{uni.get_text()}}: no such file"
severity: DiagnosticSeverity = DiagnosticSeverity.Error

@staticmethod
def get_option(uni: UNI) -> str:
Expand Down Expand Up @@ -62,23 +52,18 @@ def __call__(self, uni: UNI) -> bool:
return False


@dataclass
class RepeatedTargetFinder(RepeatedFinder):
r"""Repeatedtargetfinder."""

def __init__(
self,
message: str = "{{uni.get_text()}}: is repeated on {{_uni}}",
severity: DiagnosticSeverity = DiagnosticSeverity.Warning,
) -> None:
r"""Init.
message: str = "{{uni.get_text()}}: is repeated on {{_uni}}"
severity: DiagnosticSeverity = DiagnosticSeverity.Warning

def __post_init__(self) -> None:
r"""Post init.
:param message:
:type message: str
:param severity:
:type severity: DiagnosticSeverity
:rtype: None
"""
super().__init__(message, severity)
self.parser = get_parser("make")

def is_include_node(self, node: Node) -> bool:
Expand Down Expand Up @@ -119,6 +104,7 @@ def filter(self, uni: UNI) -> bool:


# https://github.com/alemuller/tree-sitter-make/issues/22
@dataclass(init=False)
class DefinitionFinder(RepeatedTargetFinder):
r"""Definitionfinder."""

Expand Down Expand Up @@ -223,6 +209,7 @@ def uni2document(uni: UNI) -> str:
```"""


@dataclass(init=False)
class ReferenceFinder(RepeatedTargetFinder):
r"""Referencefinder."""

Expand Down

0 comments on commit b038136

Please sign in to comment.