Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 13, 2024
1 parent 2a822ea commit ad7e287
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
https://www.sphinx-doc.org/en/master/usage/configuration.html
"""

from termux_language_server import __version__ as version # type: ignore
from termux_language_server._metainfo import ( # type: ignore
author,
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Provide ``__version__`` for
`importlib.metadata.version() <https://docs.python.org/3/library/importlib.metadata.html#distribution-versions>`_.
"""

from typing import Literal

try:
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""This module can be called by
`python -m <https://docs.python.org/3/library/__main__.html>`_.
"""

from argparse import ArgumentParser, RawDescriptionHelpFormatter
from contextlib import suppress
from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/finders.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Finders
===========
"""

from copy import deepcopy
from dataclasses import dataclass

Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/misc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Misc
========
"""

from typing import Any

from .. import FILETYPE
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/misc/color_map.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Portage's color.map
=======================
"""

from typing import Any

from tree_sitter_lsp.misc import get_soup
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/misc/ebuild.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Portage's ebuild
====================
"""

from typing import Any

from tree_sitter_lsp.misc import get_soup
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/misc/licenses.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Licenses
============
"""

from license_expression import get_license_index

LICENSES = [
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/misc/make_conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Portage's make.conf
=======================
"""

from typing import Any

from tree_sitter_lsp.misc import get_soup
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/misc/makepkg_conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""makepkg.conf
================
"""

from typing import Any

from tree_sitter_lsp.misc import get_soup
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/misc/pkgbuild.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""PKGBUILD
============
"""

import os
from typing import Any

Expand Down
9 changes: 4 additions & 5 deletions src/termux_language_server/misc/termux.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Termux
==========
"""

from typing import Any

from tree_sitter_lsp.misc import get_soup
Expand Down Expand Up @@ -137,11 +138,9 @@ def init_schema() -> dict[str, dict[str, Any]]:
}
schemas["build.sh"]["propertyNames"]["not"]["anyOf"] += [obj]

schemas["build.sh"]["properties"]["TERMUX_PKG_HOMEPAGE"][
"format"
] = schemas["build.sh"]["properties"]["TERMUX_PKG_SRCURL"][
"format"
] = "uri"
schemas["build.sh"]["properties"]["TERMUX_PKG_HOMEPAGE"]["format"] = (
schemas["build.sh"]["properties"]["TERMUX_PKG_SRCURL"]["format"]
) = "uri"
schemas["build.sh"]["properties"]["TERMUX_PKG_MAINTAINER"][
"default"
] = "@termux"
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/packages/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Packages
============
"""

from .. import FILETYPE

PACKAGE_VARIABLES = {
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/packages/pkgbuild.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""PKGBUILD packages
=====================
"""

from pathlib import Path

from jinja2 import Template
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/schema.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Schema
==========
"""

from dataclasses import dataclass
from typing import Literal

Expand Down
15 changes: 10 additions & 5 deletions src/termux_language_server/server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Server
==========
"""

import re
from typing import Any

Expand Down Expand Up @@ -263,11 +264,15 @@ def completions(params: CompletionParams) -> CompletionList:
[
CompletionItem(
k,
kind=CompletionItemKind.Function
if v.get("const") == 0
else CompletionItemKind.Field
if v.get("type") == "array"
else CompletionItemKind.Variable,
kind=(
CompletionItemKind.Function
if v.get("const") == 0
else (
CompletionItemKind.Field
if v.get("type") == "array"
else CompletionItemKind.Variable
)
),
documentation=MarkupContent(
MarkupKind.Markdown, v["description"]
),
Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/tools/namcap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Namcap
==========
"""

from lsprotocol.types import Diagnostic, DiagnosticSeverity, Position, Range


Expand Down
1 change: 1 addition & 0 deletions src/termux_language_server/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""Utils
=========
"""

import json
import os
from typing import Any, Literal
Expand Down
1 change: 1 addition & 0 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
r"""Test schema."""

import os

from tree_sitter_languages import get_parser
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
r"""Test utils."""

from termux_language_server.utils import get_schema


Expand Down

0 comments on commit ad7e287

Please sign in to comment.