Skip to content

Commit d4203f6

Browse files
committed
Fixed group plugin crashing on ENV vars for enabled setting
1 parent 871e26c commit d4203f6

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

material/plugins/group/config.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,12 @@
2727

2828
# Group plugin configuration
2929
class GroupConfig(Config):
30-
enabled = Type(bool, default = False)
30+
# While the canonical type for this setting is obviously bool, setting it
31+
# from environment variables seems to have different effects on different
32+
# systems. For instance, setting CI=true seems to correctly work on macOS,
33+
# but not on Linux – see https://t.ly/MWj0H.
34+
#
35+
# Thus, as long as the value evaluates to a truthy or falsy value, the
36+
# plugin will work as expected, until we find a better solution.
37+
enabled = Type((bool, str, int), default = False)
3138
plugins = Type((list, dict))

src/plugins/group/config.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,12 @@
2727

2828
# Group plugin configuration
2929
class GroupConfig(Config):
30-
enabled = Type(bool, default = False)
30+
# While the canonical type for this setting is obviously bool, setting it
31+
# from environment variables seems to have different effects on different
32+
# systems. For instance, setting CI=true seems to correctly work on macOS,
33+
# but not on Linux – see https://t.ly/MWj0H.
34+
#
35+
# Thus, as long as the value evaluates to a truthy or falsy value, the
36+
# plugin will work as expected, until we find a better solution.
37+
enabled = Type((bool, str, int), default = False)
3138
plugins = Type((list, dict))

0 commit comments

Comments
 (0)