Skip to content

Commit 75fb0a3

Browse files
committed
Add cargo fmt for Hypothesis-Ruby
1 parent 8b75c1e commit 75fb0a3

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

.github/workflows/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- check-quality
2626
- lint-ruby
2727
- check-ruby-tests
28+
- check-rust-in-ruby-format
2829
- check-conjecture-rust-format
2930
- check-rust-tests
3031
- audit-conjecture-rust

hypothesis-ruby/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ wrappable_struct!(
5050

5151
class!(HypothesisCoreDataSource);
5252

53+
#[rustfmt::skip]
5354
methods!(
5455
HypothesisCoreDataSource,
5556
itself,
@@ -149,6 +150,7 @@ wrappable_struct!(
149150

150151
class!(HypothesisCoreEngine);
151152

153+
#[rustfmt::skip]
152154
methods!(
153155
HypothesisCoreEngine,
154156
itself,
@@ -277,6 +279,7 @@ wrappable_struct!(
277279

278280
class!(HypothesisCoreIntegers);
279281

282+
#[rustfmt::skip]
280283
methods!(
281284
HypothesisCoreIntegers,
282285
itself,
@@ -333,6 +336,7 @@ wrappable_struct!(
333336

334337
class!(HypothesisCoreRepeatValues);
335338

339+
#[rustfmt::skip]
336340
methods!(
337341
HypothesisCoreRepeatValues,
338342
itself,
@@ -394,6 +398,7 @@ wrappable_struct!(
394398

395399
class!(HypothesisCoreBoundedIntegers);
396400

401+
#[rustfmt::skip]
397402
methods!(
398403
HypothesisCoreBoundedIntegers,
399404
itself,

tooling/src/hypothesistooling/__main__.py

+10
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,16 @@ def check_ruby_tests():
475475
hr.rake_task("minitest")
476476

477477

478+
@ruby_task
479+
def format_rust_in_ruby():
480+
hr.cargo("fmt")
481+
482+
483+
@ruby_task
484+
def check_rust_in_ruby_format():
485+
hr.cargo("fmt", "--", "--check")
486+
487+
478488
@task()
479489
def python(*args):
480490
os.execv(sys.executable, (sys.executable,) + args)

tooling/src/hypothesistooling/projects/hypothesisruby.py

+6
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ def ensure_bundler():
140140
bundle_command("install")
141141

142142

143+
def cargo(*args):
144+
install.ensure_rustup()
145+
with in_dir(BASE_DIR):
146+
subprocess.check_call(("cargo",) + args)
147+
148+
143149
RUBY_TO_PRINT_VERSION = """
144150
require 'rubygems'
145151
spec = Gem::Specification::load(%r)

0 commit comments

Comments
 (0)