Skip to content

Commit

Permalink
Add .gitattributes and .editorconfig files
Browse files Browse the repository at this point in the history
  • Loading branch information
hun1er committed Feb 16, 2025
1 parent dcb1ef0 commit 6b01c10
Show file tree
Hide file tree
Showing 2 changed files with 286 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#######################################
# Core Options #
#######################################

# This file is the top-most EditorConfig file
root = true

# All Files
[*]
charset = utf-8
guidelines = 120
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

#######################################
# File Extension Settings #
#######################################

# Markdown
[*.{md,mdx}]
trim_trailing_whitespace = false

# JSON
[*.{json,json5,webmanifest}]
indent_size = 2

# YAML
[*.{yml,yaml,clang-format,clang-tidy}]
indent_size = 2

# CMake
[{CMakeLists.txt,*.cmake,*.rst}]
indent_size = 2
indent_style = space

# Makefile
[Makefile]
end_of_line = lf
indent_style = tab

# Visual Studio Solution
[*.sln]
indent_style = tab

# C/C++
[*.{c++,c,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]
end_of_line = lf

# C#
[*.cs]
end_of_line = crlf
csharp_prefer_braces = true

# Pawn
[*.{inc,sma,sp}]
end_of_line = lf

# Python
[*.{py,py3}]
guidelines = 88
224 changes: 224 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
##############
# Common #
##############

# Auto detect text files and perform LF normalization
* text=auto

# Archives
*.7z binary
*.bz binary
*.bz2 binary
*.bzip2 binary
*.gz binary
*.lz binary
*.lzma binary
*.rar binary
*.tar binary
*.taz binary
*.tbz binary
*.tbz2 binary
*.tgz binary
*.tlz binary
*.txz binary
*.xz binary
*.Z binary
*.zip binary
*.zst binary

# Audio
*.kar binary
*.m4a binary
*.mid binary
*.midi binary
*.mp3 binary
*.ogg binary
*.ra binary

# Documents
*.adoc text
*.bibtex text diff=bibtex
*.csv text eol=crlf
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.epub diff=astextplain
*.md text diff=markdown
*.mdx text diff=markdown
*.mustache text
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.sql text
*.tab text
*.tex text diff=tex
*.textile text
*.tsv text
*.txt text

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

# Graphics
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.gifv binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpeg binary
*.jpg binary
*.jpx binary
*.jxr binary
*.png binary
*.psb binary
*.psd binary
*.svg binary
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary

# Scripts
*.bash text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.fish text eol=lf
*.ksh text eol=lf
*.sh text eol=lf
*.zsh text eol=lf

# Video
*.3gp binary
*.3gpp binary
*.as binary
*.asf binary
*.asx binary
*.avi binary
*.fla binary
*.flv binary
*.m4v binary
*.mng binary
*.mov binary
*.mp4 binary
*.mpeg binary
*.mpg binary
*.ogv binary
*.swc binary
*.swf binary
*.webm binary

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

#############
# C/C++ #
#############

# Sources
*.c text eol=lf diff=cpp
*.c++ text eol=lf diff=cpp
*.cc text eol=lf diff=cpp
*.cpi text eol=lf diff=cpp
*.cpp text eol=lf diff=cpp
*.cxx text eol=lf diff=cpp
*.h text eol=lf diff=cpp
*.h++ text eol=lf diff=cpp
*.hh text eol=lf diff=cpp
*.hpp text eol=lf diff=cpp

# Compiled Object files
*.lo binary
*.o binary
*.obj binary
*.slo binary

# Precompiled Headers
*.gch binary
*.pch binary

# Compiled Dynamic libraries
*.dll binary
*.dylib binary
*.so binary

# Compiled Static libraries
*.a binary
*.la binary
*.lai binary
*.lib binary

# Executables
*.app binary
*.exe binary
*.out binary

#############
# CMake #
#############

*.cmake eol=lf
CMakeLists.txt eol=lf
CMakePresets.json eol=lf
CMakeUserPresets.json eol=lf

####################
# EditorConfig #
####################

.editorconfig eol=lf

###########
# Git #
###########

.gitattributes eol=lf
.gitignore eol=lf

######################
# MicrosoftShell #
######################

# Source files
*.mcf text eol=crlf
*.msh text eol=crlf
*.msh1 text eol=crlf
*.msh1xml text eol=crlf
*.msh2 text eol=crlf
*.msh2xml text eol=crlf
*.mshxml text eol=crlf

############
# Pawn #
############

*.inc eol=lf
*.inl eol=lf
*.sma eol=lf
*.sp eol=lf
*.vault binary

##################
# PowerShell #
##################

# Source files
*.cdxml text eol=crlf
*.ps1 text eol=crlf
*.ps1x text eol=crlf
*.ps1xml text eol=crlf
*.psd1 text eol=crlf
*.psm1 text eol=crlf
*.psrc text eol=crlf
*.pssc text eol=crlf

0 comments on commit 6b01c10

Please sign in to comment.