Re-implement and enhance `check-formatting.yml` Github Actions workflow as a Node script
@miorel đang làm issue này rồi.
Từ ngày 17/8/2024.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
The workflow introduced in #225 is currently powered by a shell command, namely yarn format && git status --porcelain piped through some not very easy to maintain inline Perl.
Let's rewrite this as a Node script that's more maintainable. This is also an opportunity to address the other TODO in the workflow file, and have it output a summary as described at https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary
The general behavior of the workflow should be:
- Run
yarn formatto rewrite any files that are not correctly formatted. This part can still happen outside Node, so for example the command we run becomes something likeyarn format && node some-script.js. - The script basically replaces the
git status --porcelainpart and the subsequent Perl expression it's piped into. The script should therefore still rungit status --porcelainfrom within Node and capture the output. - For each line in the output of
git status --porcelain, the script should remove the first 3 characters (see explanation of the format at https://git-scm.com/docs/git-status#_porcelain_format_version_1 to understand why) to get only the filename. It should then output an error message (using the format described at https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message) to indicate that the file in question doesn't respect the repository's formatting rules. - For bonus points (this part can be done as a separate PR) output a markdown summary at the end.
- If there were any files that were improperly formatted, the script should exit with a non-zero exit code so that the check fails and draws the attention of the author and reviewers.
- Ngôn ngữ chính
- TypeScript
- Star
- 20
- Fork
- 12
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của code-chronicles-code/leetcode-curriculum
-
enhancement kotlin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
good first issue tests
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Add tests for `swap` utility Đang mởgood first issue tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
good first issue tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
code-chronicles-code/leetcode-curriculum#418 · 1 bình luận ·
Tất cả issue của code-chronicles-code/leetcode-curriculum
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mksglu/context-mode#1200 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anthropics/claude-code#96687 ·
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
AOSSIE-Org/DebateAI#582 · 2 bình luận ·