Skip to content
This repository was archived by the owner on May 20, 2020. It is now read-only.

Commit 5a34e3c

Browse files
committed
Ignore rustfmt for json!() macro bodies
This is a temporary fix for a regression in rustfmt so the CI process will correctly run. Fixes #223
1 parent 74d6402 commit 5a34e3c

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/cargo.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ mod tests {
248248
fn target_from_metadata() {
249249
let ui = Ui::default();
250250

251+
// work around until https://github.com/rust-lang-nursery/rustfmt/issues/2344 is fixed
252+
#[cfg_attr(rustfmt, rustfmt_skip)]
251253
let metadata = json!({
252254
"packages": [
253255
{
@@ -271,6 +273,8 @@ mod tests {
271273
);
272274
assert_eq!(&target.crate_name(), "underscored_name");
273275

276+
// work around until https://github.com/rust-lang-nursery/rustfmt/issues/2344 is fixed
277+
#[cfg_attr(rustfmt, rustfmt_skip)]
274278
let metadata = json!({
275279
"packages": [
276280
{
@@ -294,6 +298,8 @@ mod tests {
294298
);
295299
assert_eq!(&target.crate_name(), "dashed_name");
296300

301+
// work around until https://github.com/rust-lang-nursery/rustfmt/issues/2344 is fixed
302+
#[cfg_attr(rustfmt, rustfmt_skip)]
297303
let metadata = json!({
298304
"packages": [
299305
{
@@ -317,6 +323,8 @@ mod tests {
317323
);
318324
assert_eq!(&target.crate_name(), "underscored_name");
319325

326+
// work around until https://github.com/rust-lang-nursery/rustfmt/issues/2344 is fixed
327+
#[cfg_attr(rustfmt, rustfmt_skip)]
320328
let metadata = json!({
321329
"packages": [
322330
{
@@ -335,6 +343,8 @@ mod tests {
335343
TargetKind::Library
336344
);
337345

346+
// work around until https://github.com/rust-lang-nursery/rustfmt/issues/2344 is fixed
347+
#[cfg_attr(rustfmt, rustfmt_skip)]
338348
let metadata = json!({
339349
"packages": [
340350
{
@@ -353,6 +363,8 @@ mod tests {
353363
TargetKind::Binary
354364
);
355365

366+
// work around until https://github.com/rust-lang-nursery/rustfmt/issues/2344 is fixed
367+
#[cfg_attr(rustfmt, rustfmt_skip)]
356368
let metadata = json!({
357369
"packages": [
358370
{

src/json/api.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ mod tests {
332332
#[test]
333333
fn serialize() {
334334
let module_data = Data::new().ty("module".into()).id("example::module".into());
335+
// work around until https://github.com/rust-lang-nursery/rustfmt/issues/2344 is fixed
336+
#[cfg_attr(rustfmt, rustfmt_skip)]
335337
let module_data_json = json!({
336338
"type": "module",
337339
"id": "example::module",
@@ -351,6 +353,8 @@ mod tests {
351353
.id("example::module".into())
352354
.attributes("docs".into(), "module docs".into())
353355
.attributes("name".into(), "module".into());
356+
// work around until https://github.com/rust-lang-nursery/rustfmt/issues/2344 is fixed
357+
#[cfg_attr(rustfmt, rustfmt_skip)]
354358
let module_json = json!({
355359
"type": "module",
356360
"id": "example::module",

tests/source.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,8 @@ mod tests {
571571

572572
#[test]
573573
fn run_test() {
574+
// work around until https://github.com/rust-lang-nursery/rustfmt/issues/2344 is fixed
575+
#[cfg_attr(rustfmt, rustfmt_skip)]
574576
let json = json!({
575577
"test": "value",
576578
"nonString": ["non", "string"],

0 commit comments

Comments
 (0)