Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(format): add run_format.sh script #62

Merged
merged 1 commit into from
Mar 29, 2024
Merged

ci(format): add run_format.sh script #62

merged 1 commit into from
Mar 29, 2024

Conversation

lljbash
Copy link
Collaborator

@lljbash lljbash commented Mar 29, 2024

Help users to run the format locally with the same version as GitHub Actions CI.

Also update the black version in the format.yml to 24.3.0.

Help users to run the format locally with the same version as GitHub Actions CI.

Also update the black version in the format.yml to 24.3.0.
@lljbash lljbash requested review from wiryls and fandaoyi March 29, 2024 07:01
}

# format all C/C++ files in current git repository with clang-format
check_cmd_version clang-format 17.x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

假如开发者只修改了 Python 代码但没有动过 C++,同时开发机也没有 clang 17,这种情况会不会不太方便

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他不会崩


set -euo pipefail

cd "$(dirname "$0")" || exit 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

能否避免修改工作目录,比如我经常在 dipu 目录跑各种脚本。运行

bash ../run_format.sh

就会切到仓库根目录

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不会切,source 才会

@fandaoyi fandaoyi merged commit c98cb5c into main Mar 29, 2024
4 checks passed
@fandaoyi fandaoyi deleted the llj/add-run-format branch March 29, 2024 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants