summaryrefslogtreecommitdiff
path: root/.gitattributes
diff options
context:
space:
mode:
authorIndrajit Raychaudhuri <irc@indrajit.com>2023-12-05 16:30:17 -0600
committerChristian Breunig <christian@breunig.cc>2023-12-09 15:29:20 +0100
commitff3ecc1b4d4ede0fb4ca15484a9655c628f4354f (patch)
tree500433ee770391152f6b81dcabbbf116f175acb2 /.gitattributes
parent8ef7afb9a6f243bf956cce7ad09e3871e3861ef3 (diff)
downloadvyos-1x-ff3ecc1b4d4ede0fb4ca15484a9655c628f4354f.tar.gz
vyos-1x-ff3ecc1b4d4ede0fb4ca15484a9655c628f4354f.zip
git: T5803: Adjust git configuration for baseline defaults
Apply baseline defaults for `.gitattributes` and `.vscode/settings.json` for improved developer experience. The `.gitattrbutes` settings are based on: Git documentation (https://git-scm.com/docs/gitattributes#_effects) GitHub documentation (https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings) Community templates (https://github.com/gitattributes/gitattributes) Since editor-agnostic line-ending specific settings are applied to `.gitattributes`, they can be removed from `.vscode/settings.json`. The global VSCode defaults have also been removed to avoid duplication. (cherry picked from commit c30002208d392177cb1ffc1a5c714f7ad6d573b6)
Diffstat (limited to '.gitattributes')
-rw-r--r--.gitattributes84
1 files changed, 80 insertions, 4 deletions
diff --git a/.gitattributes b/.gitattributes
index ea2cc59e4..624e00f03 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,4 +1,80 @@
-data/templates/**/*.conf linguist-language=Jinja
-*.tmpl linguist-language=Jinja
-*.xml.i linguist-language=XML
-*.xml.in linguist-language=XML
+# Common settings that generally should always be used with your language specific settings
+
+# Auto detect text files and perform LF normalization
+* text=auto
+
+#
+# The above will handle all files NOT found below
+#
+
+# Documents
+*.md text diff=markdown
+*.mdx text diff=markdown
+*.adoc text
+*.csv text eol=crlf
+*.rst text
+*.txt text
+
+# Graphics
+*.png binary
+*.jpg binary
+*.jpeg binary
+*.gif binary
+*.tif binary
+*.tiff binary
+*.ico binary
+# SVG treated as text by default.
+*.svg text
+# If you want to treat it as binary,
+# use the following line instead.
+# *.svg binary
+
+# Scripts
+*.bash text eol=lf diff=bash
+*.sh text eol=lf diff=bash
+
+# Serialisation
+*.conf text
+*.graphql text
+*.j2 text
+*.json text
+*.rules text
+*.service text
+*.toml text
+*.tmpl text linguist-language=Jinja
+*.xml text
+*.xml.i text linguist-language=XML
+*.xml.in text linguist-language=XML
+*.yaml text
+*.yml text
+
+# Text files where line endings should be preserved
+*.patch -text
+*.diff -text
+
+# Python files
+*.pxd text diff=python
+*.py text diff=python
+*.py3 text diff=python
+*.pyw text diff=python
+*.pyx text diff=python
+*.pyz text diff=python
+*.pyi text diff=python
+
+# Fix syntax highlighting on GitHub to allow comments
+.vscode/*.json linguist-language=JSON-with-Comments
+
+#
+# Exclude files from exporting
+#
+
+.gitattributes export-ignore
+.gitignore export-ignore
+.gitkeep export-ignore
+*.pyc binary export-ignore
+*.pyo binary export-ignore
+
+#
+# Enable syntax highlighting for VSCode settings
+#
+.vscode/settings.json linguist-language=jsonc