| b08ddf77 | 06-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: enable prettier
prettier is a formatter for YAML, JSON, Markdown, etc.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I7a47d02ef7382d811423b97a88132aa92b991eed |
| e0df3058 | 05-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: enable shellcheck everywhere
I have contributed fixes (or linter ignores) to all repositories so that shellcheck passes. Enable it everywhere.
Signed-off-by: Patrick Williams <patrick
format-code: enable shellcheck everywhere
I have contributed fixes (or linter ignores) to all repositories so that shellcheck passes. Enable it everywhere.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I1b771d9492f2ba3665e84e59beabee33dcc96f6f
show more ...
|
| c5ad7ff4 | 05-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: enable flake8 instead of pycodestyle
flake8 is a more complete python linter than pycodestyle as it contains pycodestyle, pyflakes and mccabe. I have contributed fixes to all repositor
format-code: enable flake8 instead of pycodestyle
flake8 is a more complete python linter than pycodestyle as it contains pycodestyle, pyflakes and mccabe. I have contributed fixes to all repositories so that flake8 passes, so switch from pycodestyle to flake8 and enable everywhere.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I93867773830d476809364f44ad78104241d66a2a
show more ...
|
| deaa350b | 12-Dec-2022 |
Ed Tanous <edtanous@google.com> |
Remove packaging dependency
Once https://gerrit.openbmc.org/c/openbmc/bmcweb/+/59633 merges, we will no longer need packaging as a dependecy. Remove it.
Signed-off-by: Ed Tanous <edtanous@google.c
Remove packaging dependency
Once https://gerrit.openbmc.org/c/openbmc/bmcweb/+/59633 merges, we will no longer need packaging as a dependecy. Remove it.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ibd75ba7290a4dbd32fe0dddbb6d47ecef78ca7c6
show more ...
|
| 5095cbe9 | 08-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: detect tcl files
openbmc-test-automation has a few tcl files which are incorrectly identified as bash by the `file` utility. Explicitly catch this extension and classify as 'tcl' even
format-code: detect tcl files
openbmc-test-automation has a few tcl files which are incorrectly identified as bash by the `file` utility. Explicitly catch this extension and classify as 'tcl' even though we don't have a linter for that language.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I2bb45b21398819d6a73cfa99aa1b5ef5f4bed164
show more ...
|
| 816c7cc1 | 08-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: option to explicitly enable linters
Sometimes it is useful to explicitly enable a single (or set of) linters. Add an option (`--enable <tool>`) such that if any enable is set then only
format-code: option to explicitly enable linters
Sometimes it is useful to explicitly enable a single (or set of) linters. Add an option (`--enable <tool>`) such that if any enable is set then only those linters will be utilized.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I49e4b760217e6a0df5c16275c466958b3a2422b3
show more ...
|
| d5d63950 | 07-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: handle incorrect 'env python3'
I noticed the `tools/owners` file was not getting the linters ran correctly and upon investigation I found that it had the wrong path for env, which cause
format-code: handle incorrect 'env python3'
I noticed the `tools/owners` file was not getting the linters ran correctly and upon investigation I found that it had the wrong path for env, which caused `file` to give incorrect results.
Fix the path in tools/owners, reformat and fix linter issues, and ensure the scripts can handle python3 scripts with the wrong env path.
I checked the codebase and there was only one other script, which happens to reside in openbmc/openbmc, which used this incorrect path. Therefore this change should have no effect on existing repositories.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ice9703afbf104e3529f2c1b29ba8ba680eb07d94
show more ...
|
| 617a3f29 | 07-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: pycodestyle: add some compatibility for black/flake8
Black has some formatting defaults that disagree with pycodestyle. Add options to pycodestyle to disable all default-disabled checks
format-code: pycodestyle: add some compatibility for black/flake8
Black has some formatting defaults that disagree with pycodestyle. Add options to pycodestyle to disable all default-disabled checks plus two that are incompatible with black. This allows commits to get in to other repos in preparation for black/flake8 roll-out.
When we switch to black/flake8 these two extras will also be disabled in flake8.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I86b4e2d21c7a89c40b98aadc3074a554201af93d
show more ...
|
| 476a7e99 | 06-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format shell scripts with beautysh
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ie72911e0f57a1f69b0bf317de8c52947886e1303 |
| bc0d5a3a | 05-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
build-unit-test-docker: sort pip installs
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Iffdc723cb931426559ea4e9cc36d9af7209f2588 |
| 200ec183 | 06-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: handle all files are ignored by linter
If all the files applicable to a linter have been ignored, then we should not call the linter since many executables fail if no source files are g
format-code: handle all files are ignored by linter
If all the files applicable to a linter have been ignored, then we should not call the linter since many executables fail if no source files are given as arguments.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I014291d807b2ef6be7ec3c5a5d3e7a4ce1de3717
show more ...
|
| 785327a7 | 05-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: run all linters before exit
Rather than stop on the first linter that fails, run them all and collect the results. Show a summary of all the failing linters at the end.
Signed-off-by:
format-code: run all linters before exit
Rather than stop on the first linter that fails, run them all and collect the results. Show a summary of all the failing linters at the end.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6cb7d67c72025ed9e755c35b64bd43a82f066309
show more ...
|
| e08ffba8 | 05-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
python: fix flake8 warnings and format with black
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ic54f4a3ecf328b0d2c65af5cfd9eb2048d671ad5 |
| 26d9d2c5 | 05-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: halt on missing linter
From a CI perspective, we want to halt if any of the tools are missing from the docker image, as a sanity check that we did not mess that up. Add an option (--all
format-code: halt on missing linter
From a CI perspective, we want to halt if any of the tools are missing from the docker image, as a sanity check that we did not mess that up. Add an option (--allow-missing) that will simply warn and continue if any linters are missing, but halt by default.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I1e39fcf80512f86679a2352a5eb29155df08162f
show more ...
|
| 3d29494c | 05-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: document current linter-config hashes
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Idbfe0ef20b156e75a28986035c12df97577dfd65 |
| 147f37ad | 04-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: add option to disable linter
Add an option that allows users to disable a linter. This is useful when the repository currently has code that is failing a linter (like gitlint) but you
format-code: add option to disable linter
Add an option that allows users to disable a linter. This is useful when the repository currently has code that is failing a linter (like gitlint) but you don't want the script to halt.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9bcfba475e1783e3763e45e4191728824b1ab166
show more ...
|
| 71b73249 | 02-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: call linters by file types
Revamp the format-code script to only look at git-managed files, so that we don't need to worry about subproject exclusions, and classify affected files based
format-code: call linters by file types
Revamp the format-code script to only look at git-managed files, so that we don't need to worry about subproject exclusions, and classify affected files based on their file type. Allow linters to specify the file types they are applicable to and call each applicable linter with the explicit files, rather than allowing the linter programs to do directory traversals (which causes problems in some cases).
Tested: I have ran this against every active repository in Gerrit to ensure I don't break any existing repositories with this change.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I70ac6de1f9925ccd35396c894b45f16e33884551
show more ...
|
| d535ecb4 | 02-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: simplify exclusion filter for clang
The clang-format linter calls have a custom ignore list. Write a python script for reusable git-ignore-like filtering and switch the clang-format li
format-code: simplify exclusion filter for clang
The clang-format linter calls have a custom ignore list. Write a python script for reusable git-ignore-like filtering and switch the clang-format linter call to use it.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I788c0e3de55fae592318a997b676c73a7f13e74c
show more ...
|
| dad9b7aa | 30-Nov-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: combine linter enablement logic
Each linter has unique logic for detecting if it should be enabled and finding the config file. Create a combined enable check function and allow each l
format-code: combine linter enablement logic
Each linter has unique logic for detecting if it should be enabled and finding the config file. Create a combined enable check function and allow each linter to provide directives on their requirements.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I4db1d44a00076f4a84f00bd254be164a321af3c1
show more ...
|
| bc85b71f | 05-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: fix for 'git worktree' model
Some developers use `git worktree` to avoid having separate clones of their source repo. When working in that model, `.git` is not a directory but a file w
format-code: fix for 'git worktree' model
Some developers use `git worktree` to avoid having separate clones of their source repo. When working in that model, `.git` is not a directory but a file with some magic content in it that tells git how to find the original source repo and branch. Just check for the existence of a `.git` (file or directory) rather than requiring it to explicitly be a directory.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I90d01894cab38493d464da47d1ce32b5da467857
show more ...
|
| 3c2e747b | 18-Nov-2022 |
Andrew Geissler <geissonator@yahoo.com> |
dbus-unit-test.py: utilize tempfile.TemporaryDirectory()
This ensures the files within it and the directory is cleaned up once the python script ends. Currently this script does not remove the tempo
dbus-unit-test.py: utilize tempfile.TemporaryDirectory()
This ensures the files within it and the directory is cleaned up once the python script ends. Currently this script does not remove the temporary directory.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: I1e7c629dcbcf1e4341b14b9c550589b69ff12b2e
show more ...
|
| 903ebb22 | 17-Nov-2022 |
Andrew Geissler <geissonator@yahoo.com> |
dbus-unit-test.py: use /tmp for temporary files
Recently saw this fail starting to pop up via internal CI: dbus-daemon[7]: Failed to start message bus: Socket name too long
The issue appears to b
dbus-unit-test.py: use /tmp for temporary files
Recently saw this fail starting to pop up via internal CI: dbus-daemon[7]: Failed to start message bus: Socket name too long
The issue appears to be that the jenkins workspace, and the corresponding socket file passed to the dbus-daemon, is too long.
As this is all running within its own docker container, just use /tmp/ as a base for the temporary files and corresponding socket file.
Tested: - Verified failing jenkins CI job now passes
Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: I5ef5b2f21c9780001b5ec38921ce3b20f1610e2d
show more ...
|
| 001055b8 | 28-Nov-2022 |
Patrick Williams <patrick@stwcx.xyz> |
build-unit-test-docker: update linux headers to 6.0
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0d34e65bb5e7ce8bd6f40e18e572a75f266dd9b2 |
| 330b0777 | 28-Nov-2022 |
Patrick Williams <patrick@stwcx.xyz> |
unit-test: always call global formatter
There has been some confusion about the relationship between the global and local formatters (the one here vs the one in repositories). The previous behavior
unit-test: always call global formatter
There has been some confusion about the relationship between the global and local formatters (the one here vs the one in repositories). The previous behavior was that if the local formatter existed then the global formatter was ignored. In most cases this leads to duplicative or missing functionality.
The global formatter already has some code in place for calling local formatters as secondary formatters. Leverage this and ensure the global formatter is always called.
Running the following resulted in no repositories with local formatters failing: ``` find -maxdepth 2 -name "format-code.sh" | xargs -n1 dirname | \ xargs -n1 openbmc-build-scripts/scripts/format-code.sh openbmc-build-scripts/scripts/format-code.sh entity-manager ```
I also manually inspected all of the format-code scripts and they all seem safe to utilize the global formatter as well.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I88f3266062528e7fcf6ea71515c02d2d40048ae2
show more ...
|
| d27ab4c5 | 27-Nov-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: add '--no-diff' option
When running on uncommitted content, it is helpful to avoid the output `git diff` since it is known that this will fail. Add the option so that users can run the
format-code: add '--no-diff' option
When running on uncommitted content, it is helpful to avoid the output `git diff` since it is known that this will fail. Add the option so that users can run the script and format their whole repository even on uncommitted content.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Iea6c8c35eb99ab0598085e0c9cfb1edff29c7690
show more ...
|