Skip to content

Commit 9e2cd76

Browse files
authored
Merge pull request #9 from eccenca/bugfix/fixCaseSensitiveAutocompletion-CMEM-7164
Fix case sensitive folder selection
2 parents 792f7df + 658f0e1 commit 9e2cd76

File tree

11 files changed

+832
-718
lines changed

11 files changed

+832
-718
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: v7.3.0-21-gd03545f
2+
_commit: v8.2.0
33
_src_path: gh:eccenca/cmem-plugin-template
44
author_mail: [email protected]
55
author_name: eccenca GmbH

.github/workflows/check.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
- name: Check out repository
2323
uses: actions/checkout@v5
2424

25+
- name: Cache Trivy DB
26+
id: cache-trivydb
27+
uses: actions/cache@v4
28+
with:
29+
path: .trivycache
30+
key: ${{ runner.os }}-trivydb
31+
2532
- name: Install Task
2633
uses: arduino/setup-task@v2
2734

@@ -61,9 +68,13 @@ jobs:
6168
run: |
6269
task check:deptry
6370
64-
- name: safety
71+
- name: trivy
72+
env:
73+
TRIVY_NO_PROGRESS: "true"
74+
TRIVY_CACHE_DIR: ".trivycache/"
75+
TRIVY_DISABLE_VEX_NOTICE: "true"
6576
run: |
66-
task check:safety
77+
task check:trivy
6778
6879
- name: Publish Test Report in Action
6980
uses: mikepenz/action-junit-report@v4

.gitlab-ci.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,24 @@ deptry:
6060
script:
6161
- task check:deptry
6262

63-
safety:
63+
trivy:
6464
stage: test
65+
variables:
66+
TRIVY_NO_PROGRESS: "true"
67+
TRIVY_CACHE_DIR: ".trivycache/"
68+
TRIVY_DISABLE_VEX_NOTICE: "true"
6569
script:
66-
- task check:safety
70+
- task check:trivy
71+
cache:
72+
paths:
73+
- .trivycache/
6774

6875
build:
6976
stage: build
7077
needs:
7178
- mypy
7279
- pytest
73-
- safety
80+
- trivy
7481
- deptry
7582
script:
7683
- task build

.idea/cmem-plugin-ssh.iml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
2+
default_language_version:
3+
python: python3.13
4+
25
repos:
36
- repo: local
47
hooks:
@@ -36,3 +39,9 @@ repos:
3639
stages: [post-checkout, post-merge]
3740
always_run: true
3841

42+
- id: trivy
43+
name: check:trivy
44+
description: run trivy to scan for vulnerabilities
45+
entry: task check:trivy
46+
language: python
47+
pass_filenames: false

.trivyignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# .trivyignore
2+
3+
# ignore 51358 safety - dev dependency only
4+
CVE-2022-39280

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55

66
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/)
77

8+
## [1.1.1]
9+
10+
### Fixed
11+
12+
- autocompletion for folders works now for case-sensitive folders (example: test and TEst)
13+
814
## [1.1.0] 2025-10-20
915

1016
### Fixed

Taskfile.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ includes:
2020
custom:
2121
taskfile: ./TaskfileCustom.yaml
2222
optional: true
23+
flatten: true
2324
plugin:
2425
taskfile: .tasks-plugin.yml
2526
optional: true
27+
flatten: true
2628

2729
tasks:
2830

@@ -110,7 +112,7 @@ tasks:
110112
- task: check:ruff
111113
- task: check:mypy
112114
- task: check:deptry
113-
- task: check:safety
115+
- task: check:trivy
114116

115117
check:pytest:
116118
desc: Run unit and integration tests
@@ -152,12 +154,16 @@ tasks:
152154
vars:
153155
JUNIT_FILE: ./{{.DIST_DIR}}/junit-mypy.xml
154156

155-
check:safety:
156-
desc: Complain about vulnerabilities in dependencies
157+
check:trivy:
158+
desc: Scan for vulnerabilities using Trivy
157159
<<: *preparation
158160
cmds:
159-
# ignore 51358 safety - dev dependency only
160-
- poetry run safety check -i 51358
161+
- >
162+
poetry run trivy fs
163+
--include-dev-deps
164+
--scanners vuln
165+
--exit-code 1
166+
.
161167
162168
check:deptry:
163169
desc: Complain about unused or missing dependencies

cmem_plugin_ssh/autocompletion.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ def __init__(
8080
"path",
8181
]
8282

83+
def autocomplete_query(
84+
self, query: str, depend_on_parameter_values: list[Any], context: PluginContext
85+
) -> list[Autocompletion]:
86+
"""Search for autocompletions based on a query string.
87+
88+
Override to preserve case sensitivity for accurate folder matching.
89+
"""
90+
terms = [query for query in query.split() if query.strip()]
91+
return self.autocomplete(terms, depend_on_parameter_values, context)
92+
8393
def autocomplete(
8494
self,
8595
query_terms: list[str],

poetry.lock

Lines changed: 766 additions & 705 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)