c0fab5e2 | 09-Sep-2024 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Use codespell's dictionary for spell checking
When we first enabled spell checking, we duplicated the dictionary file used by the kernel community and named it `openbmc-spelling.txt`. Since we added
Use codespell's dictionary for spell checking
When we first enabled spell checking, we duplicated the dictionary file used by the kernel community and named it `openbmc-spelling.txt`. Since we added the dictionary in 2021, only two changes have been made to it.
Meanwhile, the size of the kernel community’s dictionary has grown from 32 KB to 1.4 MB and is now included as part of the codespell library. As the dictionary is readily available on the system, we will now use it directly for spell checks. This offers several benefits:
1. Automatically use the latest dictionary whenever the codespell library is updated. 2. Reduce maintenance overhead and avoid data duplication.
In the future, if we need to add a word that is specific to OpenBMC, we can create a new dictionary file with just those entries and run a separate codespell check using that file.
Change-Id: I2897ab159e0a6c14480e1ee2593761ab550a19e9 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
0f5f0e75 | 27-Nov-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format-code: simplify codespell
* Avoid copying codespell config files into the workspace. * Drop 'ignore-words' support. * Filter out Signed-off-by lines.
The 'openbmc-spelling-ignore.txt' file co
format-code: simplify codespell
* Avoid copying codespell config files into the workspace. * Drop 'ignore-words' support. * Filter out Signed-off-by lines.
The 'openbmc-spelling-ignore.txt' file contained someone's last name, which was being triggered by codespell as being similar enough to a real word that it was identified as a mispelling. Instead of keeping their name in an ignore file, filter out the Signed-off-by.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ie2c96a000c352dc02a5dee1db3d2d9ea2b629cef
show more ...
|
fb9948a3 | 21-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Enforce commit message style
Throughout the project, it is a manual human process to enforce the idea of commit message formatting, and leads to more conflict than would ideally be required for some
Enforce commit message style
Throughout the project, it is a manual human process to enforce the idea of commit message formatting, and leads to more conflict than would ideally be required for something that's relatively algorithmic, and able to be enforced by CI. Jenkins is able to give faster response times to users, thus ensuring that committers are more likely to be able to resolve their commit message issues in a timely manner.
This commit adds the gitlint[1] application to our builds, and integrates its checks with CI in the format-code.sh script. Gitlint appears to be a relatively active project with a number of releases, relatively up to date commits on its github, and by the documentation as well as this authors testing, appears to do exactly what the project needs in terms of checks.
gitlint has a number of configuration options[2], of which the defaults appear to be ok for OpenBMCs style requirements. This commit checks in a .gitlint file that was generated via 'gitlint generate-config' to use as a starting point.
To avoid impacting the entire project at this time, this commit checks for the existence of a .openbmc-enforce-gitlint file in the root of the directory, and uses that to gate its scanning. At some point in the future, once we've determined this meets our needs, this check will be removed so that we can enforce this project-wide.
This commit makes use of the gitlint plugin system to support one important feature that OpenBMC requires for block line length. The custom line length rule allows: 1. Block comments to exceed the line length limit 2. Signed-Off-By sections to exceed the line length limit 3. Tabbed in sections to exceed the line length limit
Presumably this same mechanism could be used to handle openbmc/openbmc commits, to allow meta-<name> to precede the title and go over the allowed limit, but for the moment, format-code.sh does not apply to openbmc/openbmc, so this would be for a future change to repotest
When these fails, it attempts to give the user a message that conveys these allowals to let them fix their commit message quickly.
Tested: Created a commit with a title that was too long, as well as added a .openbmc-enforce-gitlint file in bmcweb. Ran openbmc-build-scripts and observed.
''' -: UC1 Line exceeds max length (101>72). It's possible you intended to use one of the following exceptions: 1. Put logs or bash lines in a quoted section with triple quotes (''') before and after the section 2. Put a long link at the bottom in a footnote. example: [1] https://my_long_link.com Line that was too long: : "VERY LONG LOG LINE THAT TAKES WAY TOO MUCH SPACE AND GOES OVER 72 CHARACTERS, which is a problem" '''
[1] https://jorisroovers.com/gitlint/ [2] https://jorisroovers.com/gitlint/configuration/ [3] https://jorisroovers.com/gitlint/user_defined_rules/ [4] https://github.com/jorisroovers/gitlint/issues/255#issuecomment-1063494186
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: If42a22bfeca223fd5bc8f35ed937aa5f60713f2a
show more ...
|
213cf83c | 06-Nov-2021 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
eslint: Ignore the meson-* & subprojects folder in the workspace
Modify eslint configuration to ignore the meson-* folder (ignores the meson build log files - that fails(below) the json validation t
eslint: Ignore the meson-* & subprojects folder in the workspace
Modify eslint configuration to ignore the meson-* folder (ignores the meson build log files - that fails(below) the json validation test). This helps users to re-use the build directory while running the local CI.
Also ignoring the meson subprojects folder as , we dont want eslint to be checking for errors that are not part of openbmc.
Fixes : /home/zshelle/sandbox/bmc1/openpower-hw-diags/build/meson-logs/testlog-ubasan.json 2:2 error End of file expected json/* /home/zshelle/sandbox/bmc1/openpower-hw-diags/build/meson-logs/testlog-valgrind.json 2:2 error End of file expected json/* /home/zshelle/sandbox/bmc1/openpower-hw-diags/build/meson-logs/testlog.json 2:2 error End of file expected json/* ✖ 3 problems (3 errors, 0 warnings)
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: If2f03aab86db953187a5ca8f3828263582d56712
show more ...
|
87111bb7 | 14-Aug-2021 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
JSON validation support in CI
Most of the openbmc repositories depend on JSON configuration files, which are consumed by the respective daemons at runtime.
It's a good value add to catch the JSON v
JSON validation support in CI
Most of the openbmc repositories depend on JSON configuration files, which are consumed by the respective daemons at runtime.
It's a good value add to catch the JSON validation errors early in the repository CI itself.
By default, the CI would be picking config/eslint-global-config as the default configuration to run the JSON validation. The default configuration can be overridden by the presence of the .eslintrc.json file from the repository for which the CI is running against.
Repositories cannot completely opt-out of the JSON validation, but they choose to skip whatever files/folders they want using the .eslintignore configuration file or, they can also write the rules in .eslintrc.json config file to turn errors into warnings.
This commit brings in eslint & eslint-plugin-json which does only the "json validation".
Visit the below link(s) for more details & various error's/warnings that this plugin would report: https://www.npmjs.com/package/eslint-plugin-json https://github.com/azeemba/eslint-plugin-json
I have tested all the repos under openbmc with the eslint-global-config and only two repos are breaking due to this change, they are already fixed(please check the topic: "json-validation" for more details)
Testing Example : 1. Make a json bad by purposefully removing a comma
Running the json validator on the repo using it's config >
/home/manojeda/ci_test_area/pldm/configurations/fru_master.json 19:26 error Expected comma json/*
✖ 1 problem (1 error, 0 warnings)
2. if the json is good, the validation proceeds fruther without any issues.
Change-Id: I2c2c14b18bb626b1a5ab5d818b92d5ba370e1639 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|