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.
1 parent 404848f commit 755d304Copy full SHA for 755d304
tasks/format.rake
@@ -1,5 +1,25 @@
1
-begin
+namespace :format do
2
+ begin
3
require "syntax_tree/rake_tasks"
- SyntaxTree::Rake::WriteTask.new(:format)
4
-rescue LoadError
+ SyntaxTree::Rake::WriteTask.new(:ruby)
5
+ rescue LoadError
6
+ end
7
+
8
+ task :js do
9
+ sh "npm run format", chdir: "packages/npm-packages/ruby-wasm-wasi"
10
11
12
+ task :c do
13
+ sh "find ./ext -iname *.h -o -iname *.c | xargs clang-format -i"
14
15
+end
16
17
+task :format do
18
+ if Rake::Task.task_defined?("format:ruby")
19
+ Rake::Task["format:ruby"].invoke
20
+ else
21
+ puts "\e[33mSyntaxTree not installed, skipping format:ruby\e[0m"
22
23
+ Rake::Task["format:js"].invoke
24
+ Rake::Task["format:c"].invoke
25
end
0 commit comments