You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checked the issue tracker for similar issues to ensure this is not a duplicate.
Described the feature in detail and justified the reason for the request.
Provided specific use cases and examples.
Feature description
Currently when esp-idf-kconfig is used as a pre-commit hook, it seems to create Kconfig.new files with suggested changes.
/path/to/component/Kconfig:7: line should be shorter than 120 characters
/path/to/component/Kconfig:8: line should be shorter than 120 characters
/path/to/component/Kconfig.new has been saved with suggestions for resolving the issues.
Please note that the suggestions can be wrong and you might need to re-run the checker several times for solving all issues
Within pre-commit framework, it is more common that the hook modifies the file being checked directly. This makes it easier for the developer to review the suggested change and add it to the commit. If the change is not desired, the developer can easily discard the unstaged change.
An argument such as --replace could be introduced, and passed by default to kconfcheck in .pre-commit-hooks.yaml.
Use cases
Adding esp-idf-kconfig as a pre-commit hook to a repository with several Kconfig files.
Alternatives
Manually do mv path/to/Kconfig.new path/to/Kconfig for each file processed by the pre-commit hook.
Additional context
No response
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
When using esp-idf-kconfig as a pre-commit hook, it should modify Kconfig file instead of creating Kconfig.new
When using esp-idf-kconfig as a pre-commit hook, it should modify Kconfig file instead of creating Kconfig.new (IDFGH-13810)
Oct 3, 2024
…hook
When running as pre-commit hook (specified by --replace flag), kconfcheck
will make apply the changes directly to the original file and does not
print message about re-running the check with standalone kconfcheck.
Closes#9
Checklist
Feature description
Currently when esp-idf-kconfig is used as a pre-commit hook, it seems to create Kconfig.new files with suggested changes.
Within pre-commit framework, it is more common that the hook modifies the file being checked directly. This makes it easier for the developer to review the suggested change and add it to the commit. If the change is not desired, the developer can easily discard the unstaged change.
An argument such as
--replace
could be introduced, and passed by default to kconfcheck in .pre-commit-hooks.yaml.Use cases
Adding esp-idf-kconfig as a pre-commit hook to a repository with several Kconfig files.
Alternatives
Manually do
mv path/to/Kconfig.new path/to/Kconfig
for each file processed by the pre-commit hook.Additional context
No response
The text was updated successfully, but these errors were encountered: