Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/rustfmt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: rust-lang/rustfmt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: rustfmt-2.0.0-rc.2
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
Showing 685 changed files with 22,774 additions and 9,400 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [topecongiro]
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Report rustfmt errors, failing to format inputs, etc.
title: ''
labels: bug
assignees: ''

---

**Describe the bug**

<!-- A clear and concise description of what the bug is. -->

**To Reproduce**

<!-- Steps to reproduce the behavior. If possible, please provide us with a link to your project or a minimal working example. -->

**Expected behavior**

<!-- A clear and concise description of what you expected to happen. -->

**Meta**

- rustfmt version: <!-- `rustfmt -V` -->
- From where did you install rustfmt?: <!-- rustup, crates.io, package managers, etc. -->
- How do you run rustfmt: <!-- `rustfmt`, `cargo-fmt`, via editors, etc. -->
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: 💡 Feature Request
about: Ideas for new features or improvements
labels: feature-request
---

:clipboard: **Description**
<!-- Provide a clear and concise description of the new feature and the value it will provide. -->
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/formatting-issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Formatting issues
about: Poor formatting issues
title: ''
labels: poor-formatting

---

**Input**

```rust
```

**Output**

```rust
```

**Expected output**

```rust
```

**Meta**

- rustfmt version: <!-- `rustfmt -V` -->
- From where did you install rustfmt?: <!-- rustup, crates.io, package managers, etc. -->
88 changes: 88 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: integration
on:
push:
branches:
- master
pull_request:

jobs:
integration-tests:
runs-on: ubuntu-latest
name: ${{ matrix.integration }}
strategy:
# https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
# There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
# In order to prevent overusing too much of that 60 limit, we throttle the
# number of rustfmt jobs that will run concurrently.
max-parallel: 4
fail-fast: false
matrix:
integration: [
bitflags,
error-chain,
log,
mdbook,
packed_simd,
rust-semverver,
tempdir,
futures-rs,
rust-clippy,
failure,
]
include:
# Allowed Failures
# Actions doesn't yet support explicitly marking matrix legs as allowed failures
# https://github.community/t5/GitHub-Actions/continue-on-error-allow-failure-UI-indication/td-p/37033
# https://github.community/t5/GitHub-Actions/Why-a-matrix-step-will-be-canceled-if-another-one-failed/td-p/30920
# Instead, leverage `continue-on-error`
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error
#
# Failing due to breaking changes in rustfmt 2.0 where empty
# match blocks have trailing commas removed
# https://github.com/rust-lang/rustfmt/pull/4226
- integration: chalk
allow-failure: true
- integration: crater
allow-failure: true
- integration: glob
allow-failure: true
- integration: stdsimd
allow-failure: true
# Using old rustfmt configuration option
- integration: rand
allow-failure: true
# Keep this as an allowed failure as it's fragile to breaking changes of rustc.
- integration: rust-clippy
allow-failure: true
# Using old rustfmt configuration option
- integration: packed_simd
allow-failure: true
# calebcartwright (2019-12-24)
# Keeping this as an allowed failure since it was flagged as such in the TravisCI config, even though
# it appears to have been passing for quite some time.
# Original comment was: temporal build failure due to breaking changes in the nightly compiler
- integration: rust-semverver
allow-failure: true
# Can be moved back to include section after https://github.com/rust-lang-nursery/failure/pull/298 is merged
- integration: failure
allow-failure: true

steps:
- name: checkout
uses: actions/checkout@v2

# Run build
- name: setup
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-x86_64-unknown-linux-gnu
target: x86_64-unknown-linux-gnu
override: true
profile: minimal
default: true
- name: run integration tests
env:
INTEGRATION: ${{ matrix.integration }}
TARGET: x86_64-unknown-linux-gnu
run: ./ci/integration.sh
continue-on-error: ${{ matrix.allow-failure == true }}
57 changes: 57 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: linux
on:
push:
branches:
- master
pull_request:

jobs:
test:
runs-on: ubuntu-latest
name: (${{ matrix.target }}, ${{ matrix.channel }}, ${{ matrix.cfg-release-channel }})
strategy:
# https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
# There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
# In order to prevent overusing too much of that 60 limit, we throttle the
# number of rustfmt jobs that will run concurrently.
max-parallel: 1
fail-fast: false
matrix:
target: [
x86_64-unknown-linux-gnu,
]
channel: [ nightly ]
cfg-release-channel: [
beta,
nightly,
]

env:
CFG_RELEASE_CHANNEL: ${{ matrix.cfg-release-channel }}
CFG_RELEASE: ${{ matrix.cfg-release-channel }}

steps:
- name: checkout
uses: actions/checkout@v2

# Run build
- name: setup
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.channel }}-${{ matrix.target }}
target: ${{ matrix.target }}
override: true
profile: minimal
default: true

- name: cargo-make
run: cargo install --force cargo-make

- name: build
run: |
rustc -Vv
cargo -V
cargo make build
- name: test
run: cargo make test
50 changes: 50 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: mac
on:
push:
branches:
- master
pull_request:

jobs:
test:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources
# macOS Catalina 10.15
runs-on: macos-latest
name: (${{ matrix.target }}, ${{ matrix.channel }})
strategy:
fail-fast: false
matrix:
target: [
x86_64-apple-darwin,
]
channel: [ nightly ]

env:
CFG_RELEASE_CHANNEL: nightly
CFG_RELEASE: nightly

steps:
- name: checkout
uses: actions/checkout@v2

# Run build
- name: setup
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.channel }}-${{ matrix.target }}
target: ${{ matrix.target }}
override: true
profile: minimal
default: true

- name: cargo-make
run: cargo install --force cargo-make

- name: build
run: |
rustc -Vv
cargo -V
cargo make build
- name: test
run: cargo make test
75 changes: 75 additions & 0 deletions .github/workflows/upload-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: upload

on:
release:
types: [created]

jobs:
build-release:
name: build-release
strategy:
matrix:
build: [linux-x86_64, macos-x86_64, windows-x86_64-gnu, windows-x86_64-msvc]
include:
- build: linux-x86_64
os: ubuntu-latest
rust: nightly
- build: macos-x86_64
os: macos-latest
rust: nightly
- build: windows-x86_64-gnu
os: windows-latest
rust: nightly-x86_64-gnu
- build: windows-x86_64-msvc
os: windows-latest
rust: nightly-x86_64-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true

- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: build
args: --release

- name: Build release binaries
uses: actions-rs/cargo@v1
with:
command: make
args: release

- name: Build archive
shell: bash
run: |
staging="rustfmt_${{ matrix.build }}_${{ github.event.release.tag_name }}"
mkdir -p "$staging"
cp {README.md,Configurations.md,CHANGELOG.md,LICENSE-MIT,LICENSE-APACHE} "$staging/"
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp "target/release/{rustfmt.exe,cargo-fmt.exe,rustfmt-format-diff.exe,git-rustfmt.exe}" "$staging/"
7z a "$staging.zip" "$staging"
echo "ASSET=$staging.zip" >> $GITHUB_ENV
else
cp "target/release/{rustfmt,cargo-fmt,rustfmt-format-diff,git-rustfmt} "$staging/"
tar czf "$staging.tar.gz" "$staging"
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
fi
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream
Loading