mirror of
https://github.com/actions-rust-lang/rustfmt.git
synced 2025-12-27 01:54:20 -05:00
Parse new rustfmt filename:line format
Adjust code for stripping ANSI escapes. A 0x0f character is included for switching character sets. The old "filename at line line" is still supported.
This commit is contained in:
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Parse the new rustfmt file and line number format
|
||||||
|
|
||||||
|
The format changed in https://github.com/rust-lang/rustfmt/pull/5971
|
||||||
|
|
||||||
|
Thanks to @0xcypher02 for pointing out the problem.
|
||||||
|
|
||||||
## [1.1.0] - 2022-11-21
|
## [1.1.0] - 2022-11-21
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -41,12 +41,12 @@ runs:
|
|||||||
|
|
||||||
echo "${CARGO_OUTPUT}" |
|
echo "${CARGO_OUTPUT}" |
|
||||||
# Strip color codes
|
# Strip color codes
|
||||||
sed 's/\x1B\[[0-9;]*[A-Za-z]//g' |
|
sed 's/\x1B\[[0-9;]*[A-Za-z]\x0f\?//g' |
|
||||||
# Strip (some) cursor movements
|
# Strip (some) cursor movements
|
||||||
sed 's/\x1B.[A-G]//g' |
|
sed 's/\x1B.[A-G]//g' |
|
||||||
tr "\n" "\r" |
|
tr "\n" "\r" |
|
||||||
# Wrap each location into a HTML details
|
# Wrap each location into a HTML details
|
||||||
sed -E 's#Diff in ([^\r]*?) at line ([[:digit:]]+):\r((:?[ +-][^\r]*\r)+)#<details>\n<summary>\1:\2</summary>\n\n```diff\n\3```\n\n</details>\n\n#g' |
|
sed -E 's#Diff in ([^\r]*?)( at line |:)([[:digit:]]+):\r((:?[ +-][^\r]*\r)+)#<details>\n<summary>\1:\3</summary>\n\n```diff\n\4```\n\n</details>\n\n#g' |
|
||||||
tr "\r" "\n" >> $GITHUB_STEP_SUMMARY
|
tr "\r" "\n" >> $GITHUB_STEP_SUMMARY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user