java-functional-lsp 0.6.3__tar.gz → 0.6.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- java_functional_lsp-0.6.4/.githooks/pre-commit +41 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/PKG-INFO +1 -1
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/pyproject.toml +1 -1
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/__init__.py +1 -1
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/proxy.py +13 -1
- java_functional_lsp-0.6.3/.githooks/pre-commit +0 -35
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.claude-plugin/plugin.json +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.githooks/pre-push +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/CODEOWNERS +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/ISSUE_TEMPLATE/bug-report.md +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/ISSUE_TEMPLATE/feature-request.md +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/SECURITY.md +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/dependabot.yml +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/release-drafter.yml +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/workflows/publish.yml +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/workflows/release-drafter.yml +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/workflows/stale.yml +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/workflows/test.yml +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/workflows/update-homebrew.yml +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/workflows/vscode-ext.yml +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.gitignore +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/CONTRIBUTING.md +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/LICENSE +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/README.md +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/SKILL.md +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/commands/lint-java.md +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/editors/intellij/README.md +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/editors/intellij/lsp4ij-template.json +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/editors/vscode/.vscodeignore +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/editors/vscode/README.md +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/editors/vscode/package-lock.json +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/editors/vscode/package.json +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/editors/vscode/src/extension.ts +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/editors/vscode/tsconfig.json +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/hooks/hooks.json +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/hooks/java_linter_reminder.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/scripts/ensure-lsp.sh +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/scripts/generate-formula.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/__main__.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/analyzers/__init__.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/analyzers/base.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/analyzers/exception_checker.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/analyzers/functional_checker.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/analyzers/mutation_checker.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/analyzers/null_checker.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/analyzers/spring_checker.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/cli.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/fixes.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/server.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/__init__.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/conftest.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/test_base.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/test_cli.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/test_config.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/test_e2e.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/test_exception_checker.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/test_fixes.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/test_functional_checker.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/test_mutation_checker.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/test_null_checker.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/test_proxy.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/test_spring_checker.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/tests/test_suppress.py +0 -0
- {java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/uv.lock +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Pre-commit: run lint, format check, type check, and tests.
|
|
3
|
+
# Bypass with: git commit --no-verify
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "Running pre-commit checks..."
|
|
8
|
+
|
|
9
|
+
echo " Lint..."
|
|
10
|
+
uv run ruff check src/ tests/
|
|
11
|
+
|
|
12
|
+
echo " Format..."
|
|
13
|
+
uv run ruff format --check src/ tests/
|
|
14
|
+
|
|
15
|
+
echo " Type check..."
|
|
16
|
+
uv run mypy src/
|
|
17
|
+
|
|
18
|
+
echo " Version bump check..."
|
|
19
|
+
# If source files changed, version must be bumped compared to the base branch.
|
|
20
|
+
# Compares the actual version value (not just file presence) so it works with --amend.
|
|
21
|
+
src_changed=$(git diff --cached --name-only -- 'src/' | grep -v '__pycache__' | head -1)
|
|
22
|
+
if [ -n "$src_changed" ]; then
|
|
23
|
+
# Resolve base branch: try remote main, then local main, then parent commit.
|
|
24
|
+
base_branch=$(git rev-parse --verify origin/main 2>/dev/null || git rev-parse --verify main 2>/dev/null || echo "HEAD~1")
|
|
25
|
+
# Extract the quoted version value (e.g., "0.6.4") from pyproject.toml
|
|
26
|
+
base_version=$(git show "$base_branch":pyproject.toml 2>/dev/null | grep -o 'version = "[^"]*"' | head -1)
|
|
27
|
+
staged_version=$(git show :pyproject.toml 2>/dev/null | grep -o 'version = "[^"]*"' | head -1)
|
|
28
|
+
# Skip check if either version is unresolvable (new project, missing file)
|
|
29
|
+
if [ -n "$base_version" ] && [ -n "$staged_version" ] && [ "$base_version" = "$staged_version" ]; then
|
|
30
|
+
echo "ERROR: Source files changed but version was not bumped."
|
|
31
|
+
echo "Update the version in both pyproject.toml and src/java_functional_lsp/__init__.py"
|
|
32
|
+
echo ""
|
|
33
|
+
echo "To bypass (docs/tests-only changes): git commit --no-verify"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
echo " Tests..."
|
|
39
|
+
uv run pytest -q
|
|
40
|
+
|
|
41
|
+
echo "All checks passed."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: java-functional-lsp
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
4
4
|
Summary: Java LSP server enforcing functional programming best practices — null safety, immutability, no exceptions
|
|
5
5
|
Project-URL: Homepage, https://github.com/aviadshiber/java-functional-lsp
|
|
6
6
|
Project-URL: Repository, https://github.com/aviadshiber/java-functional-lsp
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "java-functional-lsp"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.4"
|
|
8
8
|
description = "Java LSP server enforcing functional programming best practices — null safety, immutability, no exceptions"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import asyncio
|
|
6
|
+
import hashlib
|
|
6
7
|
import json
|
|
7
8
|
import logging
|
|
8
9
|
import shutil
|
|
9
10
|
from collections.abc import Callable
|
|
11
|
+
from pathlib import Path
|
|
10
12
|
from typing import Any
|
|
11
13
|
|
|
12
14
|
logger = logging.getLogger(__name__)
|
|
@@ -81,14 +83,24 @@ class JdtlsProxy:
|
|
|
81
83
|
logger.warning("jdtls not found on PATH — running in standalone mode (custom rules only)")
|
|
82
84
|
return False
|
|
83
85
|
|
|
86
|
+
# jdtls requires a -data directory for workspace metadata (index, classpath, build state).
|
|
87
|
+
# Use ~/.cache/jdtls-data/<hash> so it persists across reboots and LSP restarts.
|
|
88
|
+
# Fallback order mirrors LSP spec: rootUri → rootPath → cwd.
|
|
89
|
+
root_uri = init_params.get("rootUri") or init_params.get("rootPath") or str(Path.cwd())
|
|
90
|
+
workspace_hash = hashlib.sha256(root_uri.encode()).hexdigest()[:12]
|
|
91
|
+
data_dir = Path.home() / ".cache" / "jdtls-data" / workspace_hash
|
|
92
|
+
data_dir.mkdir(parents=True, exist_ok=True)
|
|
93
|
+
|
|
84
94
|
try:
|
|
85
95
|
self._process = await asyncio.create_subprocess_exec(
|
|
86
96
|
jdtls_path,
|
|
97
|
+
"-data",
|
|
98
|
+
str(data_dir),
|
|
87
99
|
stdin=asyncio.subprocess.PIPE,
|
|
88
100
|
stdout=asyncio.subprocess.PIPE,
|
|
89
101
|
stderr=asyncio.subprocess.PIPE,
|
|
90
102
|
)
|
|
91
|
-
logger.info("jdtls subprocess started (pid=%s)", self._process.pid)
|
|
103
|
+
logger.info("jdtls subprocess started (pid=%s, data=%s)", self._process.pid, data_dir)
|
|
92
104
|
|
|
93
105
|
# Start background reader
|
|
94
106
|
assert self._process.stdout is not None
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Pre-commit: run lint, format check, type check, and tests.
|
|
3
|
-
# Bypass with: git commit --no-verify
|
|
4
|
-
|
|
5
|
-
set -e
|
|
6
|
-
|
|
7
|
-
echo "Running pre-commit checks..."
|
|
8
|
-
|
|
9
|
-
echo " Lint..."
|
|
10
|
-
uv run ruff check src/ tests/
|
|
11
|
-
|
|
12
|
-
echo " Format..."
|
|
13
|
-
uv run ruff format --check src/ tests/
|
|
14
|
-
|
|
15
|
-
echo " Type check..."
|
|
16
|
-
uv run mypy src/
|
|
17
|
-
|
|
18
|
-
echo " Version bump check..."
|
|
19
|
-
# If source files changed, version must be bumped too
|
|
20
|
-
src_changed=$(git diff --cached --name-only -- 'src/' | grep -v '__pycache__' | head -1)
|
|
21
|
-
if [ -n "$src_changed" ]; then
|
|
22
|
-
version_changed=$(git diff --cached --name-only -- 'pyproject.toml' 'src/java_functional_lsp/__init__.py' | head -1)
|
|
23
|
-
if [ -z "$version_changed" ]; then
|
|
24
|
-
echo "ERROR: Source files changed but version was not bumped."
|
|
25
|
-
echo "Update the version in both pyproject.toml and src/java_functional_lsp/__init__.py"
|
|
26
|
-
echo ""
|
|
27
|
-
echo "To bypass (docs/tests-only changes): git commit --no-verify"
|
|
28
|
-
exit 1
|
|
29
|
-
fi
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
echo " Tests..."
|
|
33
|
-
uv run pytest -q
|
|
34
|
-
|
|
35
|
-
echo "All checks passed."
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/ISSUE_TEMPLATE/bug-report.md
RENAMED
|
File without changes
|
{java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/ISSUE_TEMPLATE/feature-request.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/workflows/release-drafter.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/.github/workflows/update-homebrew.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/editors/intellij/lsp4ij-template.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{java_functional_lsp-0.6.3 → java_functional_lsp-0.6.4}/src/java_functional_lsp/analyzers/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|