We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e1d89ee + 85f6134 commit 081e6c1Copy full SHA for 081e6c1
lib/syntax_tree/cli.rb
@@ -303,10 +303,11 @@ def run(item)
303
options.print_width,
304
options: options.formatter_options
305
)
306
+ changed = source != formatted
307
- File.write(filepath, formatted) if item.writable?
308
+ File.write(filepath, formatted) if item.writable? && changed
309
- color = source == formatted ? Color.gray(filepath) : filepath
310
+ color = changed ? filepath : Color.gray(filepath)
311
delta = ((Time.now - start) * 1000).round
312
313
puts "#{color} #{delta}ms"
0 commit comments