Skip to content

Conversation

@MoritzWeber0
Copy link
Member

@MoritzWeber0 MoritzWeber0 commented May 3, 2025

Description

Add pre-commit hooks:

  • Gitleaks to identify secrets before pushing them
  • Check for large files (to avoid a large repository)
  • Check for invalid file structures
  • Add new line to the end of each file (to avoid changes to the last line when content is added to a file)
  • Remove trailing whitespaces. Since sometimes a double whitespace was used for a new line, I changed it to \ for new lines. This is a lot more readable (whitespaces are usually not displayed in default editor setups)
  • actionlint to check for valid Github Actions files

See #80

@MoritzWeber0 MoritzWeber0 added the technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc. label May 3, 2025
@netlify
Copy link

netlify bot commented May 3, 2025

Deploy Preview for fipguide ready!

Name Link
🔨 Latest commit 9cf2a9f
🔍 Latest deploy log https://app.netlify.com/sites/fipguide/deploys/6818da9afeac030008b668d7
😎 Deploy Preview https://deploy-preview-99--fipguide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@MoritzWeber0 MoritzWeber0 force-pushed the pre-commit branch 2 times, most recently from 1ac2136 to 6034e81 Compare May 3, 2025 18:31
@therobrob
Copy link
Member

Sounds good.
Two Questions:

  • what´s the limitation for the file size? Do we need to specify a value here?
  • Is it mandatory to use a \ for a newline? I think it's a bit counterintuitive for contributors, isn´t it?

@MoritzWeber0
Copy link
Member Author

MoritzWeber0 commented May 4, 2025

what´s the limitation for the file size? Do we need to specify a value here?

The default is 500kB, but we can also change it to a different value.

Is it mandatory to use a \ for a newline? I think it's a bit counterintuitive for contributors, isn´t it?

That's the CommonMark syntax, either <br />, two new lines, \ or two whitespaces. There are reasons to avoid the two whitespaces because it's hard to read (as mentioned above, default editors don't show trailing whitespaces, and in reviews it's also hard to overlook them).

The most known markdown guide also recommends to avoid double-whitespaces as line-breakers:
https://www.markdownguide.org/basic-syntax/#line-break-best-practices

You can use two or more spaces (commonly referred to as “trailing whitespace”) for line breaks in nearly every Markdown application, but it’s controversial. It’s hard to see trailing whitespace in an editor, and many people accidentally or intentionally put two spaces after every sentence. For this reason, you may want to use something other than trailing whitespace for line breaks.

To be fair, I don't expect non-tech contributors to run the pre-commit hooks, it's also not part of the content contribution guide. That's something we as maintainers have to do in the end.

@lenderom lenderom merged commit 52eb18e into main May 5, 2025
7 checks passed
@lenderom lenderom deleted the pre-commit branch May 5, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants