Skip to content

Commit

Permalink
converting tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ppekrol committed Oct 30, 2015
1 parent a6ae341 commit baf5b71
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 43 deletions.
68 changes: 32 additions & 36 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,48 +1,46 @@
# Auto detect text files and perform LF normalization
* text=auto


# Custom for Visual Studio
*.cs text diff=csharp eol=crlf
*.sln text merge=union eol=crlf
*.csproj text merge=union eol=crlf
*.vbproj text merge=union
*.fsproj text merge=union
*.dbproj text merge=union
*.ascx text eol=crlf
*.xaml text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
*.coffee text eol=crlf
*.config text eol=crlf
*.css text eol=crlf
*.nuspec text eol=crlf
*.scss text eol=crlf
*.cshtml text eol=crlf
*.htm text eol=crlf
*.html text eol=crlf
*.js text eol=crlf
*.ts text eol=crlf
*.msbuild text eol=crlf
*.resx text merge=union
*.ruleset text
*.Stylecop text
*.targets text eol=crlf
*.tt text
*.txt text eol=crlf
*.vb text eol=crlf
*.vbhtml text eol=crlf
*.xml text eol=crlf
*.xunit text eol=crlf
*.cs text diff=csharp eol=crlf filter=raven-spacify
*.sln text merge=union eol=crlf filter=raven-spacify
*.csproj text merge=union eol=crlf filter=raven-spacify
*.vbproj text merge=union filter=raven-spacify
*.fsproj text merge=union filter=raven-spacify
*.dbproj text merge=union filter=raven-spacify
*.ascx text eol=crlf filter=raven-spacify
*.xaml text eol=crlf filter=raven-spacify
*.cmd text eol=crlf filter=raven-spacify
*.ps1 text eol=crlf filter=raven-spacify
*.coffee text eol=crlf filter=raven-spacify
*.config text eol=crlf filter=raven-spacify
*.css text eol=crlf filter=raven-spacify
*.nuspec text eol=crlf filter=raven-spacify
*.scss text eol=crlf filter=raven-spacify
*.cshtml text eol=crlf filter=raven-spacify
*.htm text eol=crlf filter=raven-spacify
*.html text eol=crlf filter=raven-spacify
*.js text eol=crlf filter=raven-spacify
*.ts text eol=crlf filter=raven-spacify
*.msbuild text eol=crlf filter=raven-spacify
*.resx text merge=union filter=raven-spacify
*.ruleset text filter=raven-spacify
*.Stylecop text filter=raven-spacify
*.targets text eol=crlf filter=raven-spacify
*.tt text filter=raven-spacify
*.txt text eol=crlf filter=raven-spacify
*.vb text eol=crlf filter=raven-spacify
*.vbhtml text eol=crlf filter=raven-spacify
*.xml text eol=crlf filter=raven-spacify
*.xunit text eol=crlf filter=raven-spacify
*.java text eol=lf filter=raven-spacify

*.bmp binary
*.gif binary
*.ico binary
*.jpg binary
*.png binary



# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
Expand All @@ -54,5 +52,3 @@
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

*.java text eol=lf
3 changes: 3 additions & 0 deletions git_setup.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\git_setup.ps1' %*
17 changes: 17 additions & 0 deletions git_setup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$gitPath = "C:\Program Files\Git\bin\git.exe";
If (Test-Path $gitPath) {
} else {
$gitPath = "C:\Program Files (x86)\Git\bin\git.exe";
}

$filterToInsert = 'expand --tabs=4 --initial'

&$gitPath config --global filter.raven-spacify.clean $filterToInsert

$filterThatWasInserted = &$gitPath config --global --get filter.raven-spacify.clean

if ($filterToInsert -eq $filterThatWasInserted) {
Write-Host 'Git setup successful. Filter added.' -foregroundcolor "green"
} else {
Write-Host 'Git setup failed. Filter was not added.' -foregroundcolor "red"
}
7 changes: 0 additions & 7 deletions normalize-crlf.ps1

This file was deleted.

39 changes: 39 additions & 0 deletions normalize.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
foreach ($ext in @(
"*.cs",
"*.sln",
"*.csproj",
"*.vbproj",
"*.fsproj",
"*.dbproj",
"*.ascx",
"*.xaml",
"*.cmd",
"*.ps1",
"*.coffee",
"*.config",
"*.css",
"*.nuspec",
"*.scss",
"*.cshtml",
"*.htm",
"*.html",
"*.js",
"*.ts",
"*.msbuild",
"*.resx",
"*.ruleset",
"*.Stylecop",
"*.targets",
"*.tt",
"*.txt",
"*.vb",
"*.vbhtml",
"*.xml",
"*.xunit",
"*.java")) {
(dir -Recurse -Filter $ext) | foreach {
$file = gc $_.FullName
$file | sc $_.FullName
}

}

0 comments on commit baf5b71

Please sign in to comment.