Skip to content

Commit 70f82ad

Browse files
committed
Virtual Codebase fingerprint plugin error
Signed-off-by: Pratik Dey <pratikrocks.dey11@gmail.com>
1 parent f55687f commit 70f82ad

102 files changed

Lines changed: 3389 additions & 2409 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ include_package_data = true
3131
zip_safe = false
3232
install_requires =
3333
bitarray==1.1.0
34-
commoncode
34+
commoncode>=21.6.11
3535
click
3636
simplejson
3737
unicodecsv

src/deltacode/__init__.py

Lines changed: 303 additions & 325 deletions
Large diffs are not rendered by default.

src/deltacode/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def write_json(deltacode, outfile, all_delta_types=False):
4444
"""
4545
results = OrderedDict([
4646
('deltacode_notice', get_notice()),
47+
# ('new_scan_options', deltacode.new_scan_options),
48+
# ('old_scan_options', deltacode.old_scan_options),
4749
('deltacode_options', deltacode.options),
4850
('deltacode_version', __version__),
4951
('deltacode_errors', collect_errors(deltacode)),

src/deltacode/test_utils.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import json
3535

3636
from commoncode.system import on_windows
37+
from commoncode import paths
3738
from commoncode.resource import VirtualCodebase
3839

3940
def run_scan_click(options, monkeypatch=None, test_mode=True, expected_rc=0, env=None):
@@ -149,21 +150,14 @@ def streamline_errors(errors):
149150
errors[i] = cleaned_error
150151

151152

153+
def get_aligned_path(delta, path, new_file):
154+
OFFSET = delta.NEW_CODEBASE_OFFSET if new_file else delta.OLD_CODEBASE_OFFSET
155+
return "/".join(paths.split(path)[OFFSET:])
156+
152157
def streamline_headers(headers):
153158
"""
154159
Modify the `headers` list of mappings in place to make it easier to test.
155160
"""
156161
headers.pop('deltacode_version', None)
157162
headers.pop('deltacode_options', None)
158163
streamline_errors(headers['deltacode_errors'])
159-
160-
161-
def fetch_files(location):
162-
codebase = VirtualCodebase(location)
163-
resourceFiles = []
164-
resources = codebase.walk_filtered(topdown=True)
165-
166-
for index , obj in enumerate(resources):
167-
resourceFiles.append([obj , ''])
168-
169-
return resourceFiles

0 commit comments

Comments
 (0)