Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sass.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ def compile_dirname(
fs_encoding = sys.getfilesystemencoding() or sys.getdefaultencoding()
for dirpath, _, filenames in os.walk(search_path):
filenames = [
filename for filename in filenames if filename.endswith('.scss')
filename for filename in filenames
if filename.endswith('.scss') and not filename.startswith('_')
]
for filename in filenames:
input_filename = os.path.join(dirpath, filename)
Expand Down
12 changes: 11 additions & 1 deletion sasstests.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,6 @@ def test_successful(self):
# Make sure we don't compile non-scss files
write_file(os.path.join(input_dir, 'baz.txt'), 'Hello der')

# the api for this is weird, why does it need source?
sass.compile(dirname=(input_dir, output_dir))
assert os.path.exists(output_dir)
assert os.path.exists(os.path.join(output_dir, 'foo'))
Expand All @@ -711,6 +710,17 @@ def test_successful(self):
self.assertEqual(contentsf1, 'a b {\n width: 100%; }\n')
self.assertEqual(contentsf2, 'foo {\n width: 100%; }\n')

def test_ignores_underscored_files(self):
with tempdir() as tmpdir:
input_dir = os.path.join(tmpdir, 'input')
output_dir = os.path.join(tmpdir, 'output')
os.mkdir(input_dir)
write_file(os.path.join(input_dir, 'f1.scss'), '@import "f2";')
write_file(os.path.join(input_dir, '_f2.scss'), 'a{color:red}')

sass.compile(dirname=(input_dir, output_dir))
assert not os.path.exists(os.path.join(output_dir, '_f2.css'))

def test_error(self):
with tempdir() as tmpdir:
input_dir = os.path.join(tmpdir, 'input')
Expand Down