Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# code: language=gitattributes

######################################################################
# GITATTRIBUTES: Global
######################################################################
# See: https://www.git-scm.com/docs/gitattributes
# Details per file setting:
# text These files should be normalized (i.e. convert CRLF to LF).
# binary These files are binary and should not be diffed,
# normalized, etc. Only report if the file has changed.
# NOTE: "binary" is a macro for -diff -merge -text.
#
# Relevant builtin diff patterns (see: https://www.git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header)
# | Diff | Description |
# | ---------- | ------------------------------------------------------ |
# | `bash` | Bash language. |
# | | Covers a superset of POSIX shell functions. |
# | `css` | Cascading style sheets. |
# | `html` | HTML/XHTML documents. |
# | `markdown` | Markdown documents. |
# | `python` | Python language. |
# | `ruby` | Ruby language. |
# | `rust` | Rust language. |
# | `tex` | LaTeX documents. |

######################################################################

# ====================================================================
# MACROS #
# ====================================================================
# All macros assume the default rule is: `text eol=lf` and sets/removes attributes accordingly
# If the default rule changes, these macros must be updated as well.

# OVERRIDES
## See builtin binary definition here: https://www.git-scm.com/docs/gitattributes#_defining_macro_attributes
[attr]binary -text -diff -merge !eol

# CUSTOM

### Prevent end-of-line conversion
[attr]input -text -eol

## Diff Macros
### Useful for declaring which diff pattern to use for files that may
### not be captured correctly by Git's heuristics.
[attr]bash diff=bash
[attr]css diff=css
[attr]html diff=html
[attr]xml diff=html
[attr]markdown diff=markdown
[attr]python diff=python
[attr]ruby diff=ruby
[attr]scheme diff=scheme

### Do not generate a diff, instead print a "Binary files differ" message
### Useful for autogenerated text files that may produce large, noisy diffs
[attr]autogen -diff
[attr]lockfile -diff

### Fix syntax highlighting on GitHub to allow comments
[attr]jsonc linguist-language=JSON-with-Comments

######################################################################

# ====================================================================
# RULES
# ====================================================================

# --------------------------------------------------------------------
# DEFAULT RULE
# --------------------------------------------------------------------
# Auto detect text files and perform LF normalization
* text eol=lf

# --------------------------------------------------------------------
# PATTERN RULES
# --------------------------------------------------------------------
# Common settings that generally should always be used with your language specific settings

# Text files where line endings should be preserved
*.patch -text

# Assets
## Graphics
*.gif binary
*.ico binary
*.jpeg binary
*.jpg binary
*.png binary
*.tif binary
*.tiff binary
*.webp binary
*.svgz binary

## Fonts
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary


# These are explicitly windows files and should use crlf
*.bat eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf


# Uncommon (to Git) sourcecode files
*.scss text css


# Fix syntax highlighting on GitHub to allow comments
tsconfig.json jsonc

# Lock files (usually for managing project dependencies)
*.lock lockfile

# Auto-generated and minified files
*.map autogen
*.min.js autogen

# --------------------------------------------------------------------
# PROJECT-SPEFICIC RULES
# --------------------------------------------------------------------#

## Lock files
knapsack_rspec_report.json lockfile
package-lock.json lockfile
pnpm-lock.yaml lockfile

### Force text diff for Gemfile.lock
Gemfile.lock diff

## Executables and runtimes
*.wasm binary

## Data files
*_model-shard? binary

Loading