File tree Expand file tree Collapse file tree
modules/nextflow/src/main/groovy/nextflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -366,10 +366,12 @@ class ConfigBuilder {
366366 assert env != null
367367
368368 final ignoreIncludes = options ? options. ignoreConfigIncludes : false
369+ final ansiLog = options ? options. ansiLog : false
369370 final parser = ConfigParserFactory . create()
370371 .setRenderClosureAsString(showClosures)
371372 .setStripSecrets(stripSecrets)
372373 .setIgnoreIncludes(ignoreIncludes)
374+ .setAnsiLog(ansiLog)
373375 ConfigObject result = new ConfigObject ()
374376
375377 if ( cliParams )
Original file line number Diff line number Diff line change @@ -72,6 +72,15 @@ interface ConfigParser {
7272 */
7373 ConfigParser setProfiles (List<String > profiles )
7474
75+ /**
76+ * Toggle whether to render compilation errors with ANSI colors.
77+ *
78+ * @param value
79+ */
80+ default ConfigParser setAnsiLog(boolean value) {
81+ return this
82+ }
83+
7584 /**
7685 * Parse a config object from the given source.
7786 */
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ class ConfigParserV2 implements ConfigParser {
4949
5050 private boolean stripSecrets
5151
52+ private boolean ansiLog
53+
5254 private List<String > appliedProfiles
5355
5456 private Set<String > declaredProfiles = []
@@ -87,6 +89,12 @@ class ConfigParserV2 implements ConfigParser {
8789 return this
8890 }
8991
92+ @Override
93+ ConfigParserV2 setAnsiLog (boolean value ) {
94+ this . ansiLog = value
95+ return this
96+ }
97+
9098 @Override
9199 ConfigParserV2 setBinding (Map vars ) {
92100 this . bindingVars = vars
@@ -157,7 +165,7 @@ class ConfigParserV2 implements ConfigParser {
157165
158166 private void printErrors (Path path ) {
159167 final source = compiler. getSource()
160- final errorListener = new StandardErrorListener (' full' , false )
168+ final errorListener = new StandardErrorListener (' full' , ansiLog )
161169 println ()
162170 errorListener. beforeErrors()
163171 for ( final message : compiler. getErrors() ) {
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ class ScriptLoaderV2 implements ScriptLoader {
131131 }
132132
133133 private void printErrors (Path path ) {
134- final errorListener = new StandardErrorListener (' full' , false )
134+ final errorListener = new StandardErrorListener (' full' , session . ansiLog )
135135 println ()
136136 errorListener. beforeErrors()
137137 for ( final message : compiler. getErrors() ) {
You can’t perform that action at this time.
0 commit comments