Skip to content

Commit 0c46c23

Browse files
authored
Add support for .pde sketch extension (#59)
Previously, only sketches that use the .ino file extension were recognized. There are still popular libraries and sketches that use the .pde extension, which are either unmaintained or with maintainers who have no interest in changing the extension, so support for .pde is required for this action to be a general purpose tool for compilation testing of all Arduino projects.
1 parent e745d17 commit 0c46c23

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

compilesketches/compilesketches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ def path_is_sketch(path):
10801080
Keyword arguments:
10811081
path -- path of to check for a sketch
10821082
"""
1083-
sketch_extensions = [".ino"] # TODO: this is preparation for the addition of support for the .pde extension
1083+
sketch_extensions = [".ino", ".pde"]
10841084

10851085
path = pathlib.Path(path)
10861086

compilesketches/tests/test_compilesketches.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,10 +1065,14 @@ def test_path_is_sketch():
10651065
assert compilesketches.path_is_sketch(
10661066
path=test_data_path.joinpath("NoSketches", "NotSketch", "NotSketch.foo")) is False
10671067

1068-
# Sketch folder
1068+
# Sketch folder with .ino sketch file
10691069
assert compilesketches.path_is_sketch(
10701070
path=test_data_path.joinpath("HasSketches", "Sketch1")) is True
10711071

1072+
# Sketch folder with .pde sketch file
1073+
assert compilesketches.path_is_sketch(
1074+
path=test_data_path.joinpath("HasSketches", "Sketch2")) is True
1075+
10721076
# No files in path
10731077
assert compilesketches.path_is_sketch(
10741078
path=test_data_path.joinpath("HasSketches")) is False

0 commit comments

Comments
 (0)