Content-Length: 355329 | pFad | https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials/pull/195

F8 fix ci/cd error by Jzow · Pull Request #195 · rust-embedded/rust-raspberrypi-OS-tutorials · GitHub
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

fix ci/cd error #195

Merged
merged 10 commits into from
Sep 15, 2023
Merged

fix ci/cd error #195

merged 10 commits into from
Sep 15, 2023

Conversation

Jzow
Copy link
Contributor

@Jzow Jzow commented Sep 12, 2023

Description

Related Issue: CC #184

Pre-commit steps

  • Tested on QEMU and real HW Rasperry Pi.
    • Not needed if it is just a README change or similar.
  • Ran ./contributor_setup.sh followed by ./devtool ready_for_publish
    • You'll need Ruby with Bundler and NPM installed locally.
    • If no Rust-related files were changed, ./devtool ready_for_publish_no_rust can be used instead (faster).
    • This step is optional, but much appreciated if done.

What did this PR do

  1. Main reason: Because every time a PR is submitted during the translation of a chapter, a Github CI check will be conducted and an error will be reported.
  2. Solution: Fix Github CI running errors.

The following things were done to fix this error:

  1. Modified the year check error, many files have a deadline of 2022, which can cause Github CI to make errors when running bundle exec ruby utils/devtool.rb copyright.
  2. Modified the settings.json file and add prettierrc. json. If the code format is not followed, it will cause Github CI to run error when running bundle exec ruby utils/devtool.rb fmt_check.
  3. Revised Ruby code format (method comments) to include i.to_s ->i It does not need to be called explicitly, which will cause Github CI to error when running bundle exec ruby utils/devtool.rb rubocop

Because I need to check many files, I cannot manually modify them one by one. I will replace them in bulk and finally convert the code format.

CC @eldruin @andre-richter

Copy link
Member

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Thanks! it seems there is still a file missing, though, according to the CI.

@Jzow Jzow requested a review from eldruin September 13, 2023 04:11
Copy link
Member

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Thank you! Seems like a lot of work.
Are these changes in the comments necessary ##------- -> ## ------ (notice the extra whitespace after ##)?
Without those there would be many fewer changes in this PR.

@Jzow
Copy link
Contributor Author

Jzow commented Sep 13, 2023

If there are no spaces after the # sign, it will also report code formatting errors


utils/devtool.rb:332:1: C: [Correctable] Layout/LeadingCommentSpace: Missing space after #.
##--------------------------------------------------------------------------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
utils/devtool.rb:334:1: C: [Correctable] Layout/LeadingCommentSpace: Missing space after #.
##--------------------------------------------------------------------------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

101 files inspected, 70 offenses detected, 70 offenses autocorrectable
Error: Process completed with exit code 1.

error log

@Jzow Jzow requested a review from eldruin September 14, 2023 03:30
@eldruin
Copy link
Member

eldruin commented Sep 14, 2023

I see. Thanks for the clarification.
However, that should only be changed in the ruby files and should be unnecessary in the Makefiles, which make up a big portion of the changes, right?
Would it be possible for you to revert to ##------- in the Makefiles?

@Jzow
Copy link
Contributor Author

Jzow commented Sep 14, 2023

I see. Thanks for the clarification. However, that should only be changed in the ruby files and should be unnecessary in the Makefiles, which make up a big portion of the changes, right? Would it be possible for you to revert to ##------- in the Makefiles?

Yes, it seems that Ruby has a requirement for whitespace.

@eldruin
Copy link
Member

eldruin commented Sep 14, 2023

Thanks! That has worked but I still see a lot of ## ---- in the makefiles. For example on line 91 and 93 of 01_wait_forever/Makefile.
Maybe the search and replace did not work adequately due to a varying number of - being present.
Could you have another look?

@Jzow
Copy link
Contributor Author

Jzow commented Sep 15, 2023

Could you have another look?

Right, It seems much less now, just adding spaces to the Ruby files.

Copy link
Member

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you for your work!

@eldruin eldruin merged commit 52b7ac9 into rust-embedded:master Sep 15, 2023
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.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials/pull/195

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy