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

Revert "shellfmt: config/sources; no changes" #7554

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

The-going
Copy link
Contributor

This reverts commit 2f63a9c.

[${1} / bootinfo_emmc.bin]
[${1} / FSBL.bin]
- This is the path to the file.
It cannot contain spaces.

Description

The shellfmt utility can be run manually and makes changes to all files defined here:
lib/tools/shellfmt.sh#L66
In some cases, the changes have a clear defect and can be detected by simply reading the changes.
In some cases, we need a thorough check of the system script run in the environment in which it is to be executed.
The syntax in the system script should work equally well in both old ubuntu\debian and new operating systems.

No automatic/machine changes to system scripts should be performed without subsequent manual health checks.

It also has to do with the changes that the shellcheck utility offers. lib/tools/shellcheck.sh

Discussion. The work is in progress.

This reverts commit 2f63a9c.

`[${1} / bootinfo_emmc.bin]`
`[${1} / FSBL.bin]`          - This is the path to the file.
                               It cannot contain spaces.
@github-actions github-actions bot added size/small PR with less then 50 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... labels Dec 8, 2024
@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge 02 Milestone: First quarter release labels Dec 9, 2024
@igorpecovnik
Copy link
Member

There is another problem - found by shell-check.

 In /armbian/.tmp/work-no-uuidgen-yet-28738-4689/uboot-WiBpK/usr/lib/u-boot/platform_install.sh line 16:
  [🐳|🔨]           if $(dd if=${device} bs=1 skip="${d[$f]%:*}" count="${d[$f]#*:}" conv=notrunc status=noxfer 2> /dev/null | cmp --quiet "${f}"); then
  [🐳|🔨]              ^-- SC2091 (warning): Remove surrounding $() to avoid executing output (or use eval if intentional).

@The-going
Copy link
Contributor Author

The-going commented Dec 9, 2024

There is another problem - found by shell-check.

 In /armbian/.tmp/work-no-uuidgen-yet-28738-4689/uboot-WiBpK/usr/lib/u-boot/platform_install.sh line 16:
  [🐳|🔨]           if $(dd if=${device} bs=1 skip="${d[$f]%:*}" count="${d[$f]#*:}" conv=notrunc status=noxfer 2> /dev/null | cmp --quiet "${f}"); then
  [🐳|🔨]              ^-- SC2091 (warning): Remove surrounding $() to avoid executing output (or use eval if intentional).

In fact, we have three problems.

  1. bash lib/tools/shellcheck.sh
    and
  2. bash lib/tools/shellfmt.sh

If I run (2) then everything will return to the 2f63a9cd987 commit state

If I run the shellcheck (1) utility without any restrictions,
I will receive conflicting tips and warnings that may lead to other errors.
An example is here: 7529

I will fix this file to satisfy these two validation\changes scripts so that the algorithm remains functional.

But the third problem will remain.
These two scripts run and check\modify all files.

The person who is testing sunxi64 probably doesn't want to interfere with other families.
Maybe he probably doesn't have any other platforms, or he's focused on just one platform.

Let's think about it

@igorpecovnik
Copy link
Member

igorpecovnik commented Dec 9, 2024

In fact, we have three problems.

Understand.

so that the algorithm remains functional.

At the end, this is all matters. Those tools are not perfect, but they help having code in some better state.

But the third problem will remain.

If there is no other way, both must have ways to tell linter to ignore the file.

@igorpecovnik igorpecovnik merged commit 43166a8 into armbian:main Dec 13, 2024
@rpardini
Copy link
Member

please fix the syntax of code in that file -- that way we can just run shellcheck and shellfmt at any time, as is the case with every other file in system

  1. quote the dictionary key's values. dictionary keys are strings, there's no reason not to quote.
  2. if $() is a mistake that is being clearly pointed at by shellcheck.

@The-going
Copy link
Contributor Author

please fix the syntax of code

I will definitely do it.
There are plans to make changes to space mit next week for the next version of the kernel.

that way we can just run shellcheck and shellfmt at any time, as is the case with every other file in system

Do I understand correctly?
Are you going to continue running these scripts for all files at the same time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
02 Milestone: First quarter release Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines
Development

Successfully merging this pull request may close these issues.

3 participants