Skip to content

Commit 08e26bc

Browse files
committed
Load configuration for prettier. Allow to set the config files with options. Bump version
1 parent 9d6a01b commit 08e26bc

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/doblib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "0.19.3"
1+
VERSION = "0.19.4"

src/doblib/ci.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ def _ci_prettier(self, options, args, paths, ignores):
141141
if options.fix:
142142
cmd.append("--write")
143143

144+
config_path = self.get(
145+
base.SECTION, "prettier", "config", default=".prettierrc.yml"
146+
)
147+
if os.path.isfile(config_path):
148+
cmd.append(f"--config {config_path}")
149+
144150
return utils.call(*cmd, *args, *files, pipe=False)
145151

146152
def _ci_pylint(self, options, args, paths, ignores):
@@ -170,8 +176,9 @@ def _ci_pylint(self, options, args, paths, ignores):
170176
return 0
171177

172178
cmd = [sys.executable, "-m", "pylint"]
173-
if os.path.isfile(".pylintrc"):
174-
cmd.append("--rcfile=.pylintrc")
179+
config_path = self.get(base.SECTION, "pylint", "config", default=".pylintrc")
180+
if os.path.isfile(config_path):
181+
cmd.append(f"--rcfile={config_path}")
175182

176183
return utils.call(*cmd, *args, *files, pipe=False)
177184

0 commit comments

Comments
 (0)