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

Add 'pre-commit' framework #906

Open
wants to merge 1 commit into
base: test/ceedling_0_32_rc
Choose a base branch
from

Conversation

swaldhoer
Copy link

@swaldhoer swaldhoer commented Jul 20, 2024

This pull request adds a basic pre-commit configuration to the repository and runs the check in a CI step.

This configuration does the following:

  • check-added-large-files: prevent accidental adding of large files
  • check-case-conflict: prevent that files being added that cause problems on NTFS/Windows.
  • check-executables-have-shebangs: If file is marked executable, it shall have a shebang.
  • check-merge-conflict: do not add files, that have conflict markers
  • check-shebang-scripts-are-executable: if a file has a shebang, then it should be marked as executable
  • check-symlinks: symlinks shall point to anything meaningful
  • check-yaml: yaml files shall be valid yaml files
  • destroyed-symlinks: prevent symlinks getting converted to files (mostly a Windows thing)
  • end-of-file-fixer: POSIX 3.206 Line
  • fix-byte-order-marker: removes UTF-8 byte order marker (mostly a Windows thing)
  • mixed-line-ending: do not mix LF/CR/CRLF in a file
  • trailing-whitespace: do not use trailing whitespace (except for MarkDown files)

Let's make diffs smaller and reviews simpler :)


Actual changes by this commit: all changes are cosmetic except for

  • the following files that were marked executable, but had no shebang:
    • plugins/beep/lib/beep.rb: added ruby shebang
    • plugins/bullseye/bullseye.rake: added ruby shebang
    • plugins/bullseye/lib/bullseye.rb: added ruby shebang
    • plugins/command_hooks/lib/command_hooks.rb: added ruby shebang
    • plugins/gcov/gcov.rake: added ruby shebang
    • plugins/gcov/lib/gcov.rb: added ruby shebang
    • plugins/module_generator/lib/module_generator.rb: added ruby shebang
    • plugins/module_generator/module_generator.rake: added ruby shebang
  • the following files had a shebang, but were not marked executable:
    • Rakefile: now marked as executable
    • examples/temp_sensor/test/support/UnityHelper.h: removed executable bits
    • plugins/bullseye/config/defaults.yml: removed executable bits

fix trailing whitespace and fix end of file
fix shebang or mod
fix line endings
@swaldhoer swaldhoer changed the base branch from master to test/ceedling_0_32_rc July 20, 2024 10:04
@Letme
Copy link

Letme commented Oct 11, 2024

I like this idea that we have some sort of stylechecker (the especially those trailing whitespace). So LGTM?

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