Skip to content

Commit 02ec56d

Browse files
committed
Do not ignore by default sccs and rcs dirs
Fix for aboutcode-org/scancode-toolkit#1422 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 825755b commit 02ec56d

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Version 21.6.11
1010

1111
- Do not fail if a Codebase does not have a common shared root #23
1212
- Consider all Resource attributes when building a VirtualCodebase #23
13+
- Do not ignore by default sccs and rcs dirs https://github.com/nexB/scancode-toolkit/issues/1422
1314

1415

1516
Version 21.6.10

src/commoncode/ignore.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ def get_ignores(location, include_defaults=True):
184184

185185
'CVS': 'Default ignore: CVS artifact',
186186
'.cvsignore': 'Default ignore: CVS config artifact',
187-
'*/SCCS': 'Default ignore: CVS artifact',
188187

189188
'*/_MTN': 'Default ignore: Monotone artifact',
190189
'*/_darcs': 'Default ignore: Darcs artifact',

tests/test_resource.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
from os.path import exists
1414
from os.path import join
1515

16-
import pytest
17-
1816
from commoncode.fileutils import parent_directory
1917
from commoncode.testcase import FileBasedTesting
2018
from commoncode.resource import Codebase
@@ -42,13 +40,16 @@ def test_walk_defaults(self):
4240
]
4341
assert [(r.name, r.is_file) for r in results] == expected
4442

45-
@pytest.mark.xfail(reason='FIXME: a fix for ticket #1422 is needed')
46-
def test_Codebase_with_only_ignores_should_not_fail_to_create(self):
43+
def test_Codebase_do_not_ignore_by_default_older_sccs_and_rcs_dirs(self):
44+
# See https://github.com/nexB/scancode-toolkit/issues/1422
4745
from commoncode.fileutils import create_dir
4846
test_codebase = self.get_temp_dir()
4947
create_dir(join(test_codebase, 'sccs', 'a'))
5048
create_dir(join(test_codebase, 'rcs', 'b'))
51-
Codebase(test_codebase)
49+
codebase = Codebase(test_codebase)
50+
results = list(codebase.walk(topdown=True, skip_root=True))
51+
expected = ['rcs', 'b', 'sccs', 'a']
52+
assert [r.name for r in results] == expected
5253

5354
def test_walk_topdown(self):
5455
test_codebase = self.get_test_loc('resource/codebase')
@@ -1055,7 +1056,7 @@ def test_virtual_codebase_can_process_minimal_resources_with_only_path(self):
10551056
])
10561057
]
10571058
assert [r.to_dict() for r in codebase.walk()] == expected
1058-
1059+
10591060
def test_VirtualCodebase_account_fingerprint_attribute(self):
10601061
test_file = self.get_test_loc("resource/virtual_codebase/fingerprint_attribute.json")
10611062
codebase = VirtualCodebase(test_file)
@@ -1352,7 +1353,6 @@ def test_VirtualCodebase_can_be_created_without_RecursionError(self):
13521353
VirtualCodebase(test_file)
13531354

13541355

1355-
13561356
class TestResource(FileBasedTesting):
13571357
test_data_dir = join(dirname(__file__), 'data')
13581358

0 commit comments

Comments
 (0)