Skip to content

Commit cac780c

Browse files
MrVitalyMarkPieszak
authored andcommitted
style(code): nоrmalization of line endings
Normalization of line endings: - Add .gitattributes; - Normalization existed files with mixes line endings.
1 parent 892a98f commit cac780c

File tree

6 files changed

+204
-106
lines changed

6 files changed

+204
-106
lines changed

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

content/.gitattributes

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
###############################################################################
2+
# Auto detect text files and perform LF normalization
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Force text and use native line endings for configuration and plain text
8+
# files, for easier editing on any platform.
9+
###############################################################################
10+
*.cs text
11+
*.cshtml text
12+
*.js text
13+
*.vue text
14+
*.json text
15+
*.css text
16+
*.md text
17+
*.config text
18+
19+
###############################################################################
20+
# Set default behavior for command prompt diff.
21+
###############################################################################
22+
*.cs diff=csharp
23+
24+
###############################################################################
25+
# Set the merge driver for project and solution files
26+
#
27+
# Merging from the command prompt will add diff markers to the files if there
28+
# are conflicts (Merging from VS is not affected by the settings below, in VS
29+
# the diff markers are never inserted). Diff markers may cause the following
30+
# file extensions to fail to load in VS. An alternative would be to treat
31+
# these files as binary and thus will always conflict and require user
32+
# intervention with every merge. To do so, just uncomment the entries below
33+
###############################################################################
34+
*.sln merge=binary
35+
*.csproj merge=binary

content/Models/WeatherForecast.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
namespace Vue2Spa.Models
2-
{
3-
public class WeatherForecast
4-
{
1+
namespace Vue2Spa.Models
2+
{
3+
public class WeatherForecast
4+
{
55
public string DateFormatted { get; set; }
6-
7-
public string Summary { get; set; }
8-
9-
public int TemperatureC { get; set; }
10-
11-
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
12-
}
13-
}
6+
7+
public string Summary { get; set; }
8+
9+
public int TemperatureC { get; set; }
10+
11+
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
12+
}
13+
}

content/Providers/IWeatherProvider.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using Vue2Spa.Models;
33

4-
namespace Vue2Spa.Providers
5-
{
6-
public interface IWeatherProvider
4+
namespace Vue2Spa.Providers
5+
{
6+
public interface IWeatherProvider
77
{
8-
List<WeatherForecast> GetForecasts();
9-
}
10-
}
8+
List<WeatherForecast> GetForecasts();
9+
}
10+
}
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using Vue2Spa.Models;
5-
6-
namespace Vue2Spa.Providers
7-
{
8-
public class WeatherProviderFake : IWeatherProvider
9-
{
10-
private readonly string[] summaries = {
11-
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
12-
};
13-
14-
private List<WeatherForecast> WeatherForecasts { get; set; }
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using Vue2Spa.Models;
5+
6+
namespace Vue2Spa.Providers
7+
{
8+
public class WeatherProviderFake : IWeatherProvider
9+
{
10+
private readonly string[] summaries = {
11+
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
12+
};
13+
14+
private List<WeatherForecast> WeatherForecasts { get; set; }
1515

1616
public WeatherProviderFake()
1717
{
1818
Initialize(50);
1919
}
20-
21-
private void Initialize(int quantity)
22-
{
23-
var rng = new Random();
24-
WeatherForecasts = Enumerable.Range(1, quantity).Select(index => new WeatherForecast
25-
{
26-
DateFormatted = DateTime.Now.AddDays(index).ToString("d"),
27-
TemperatureC = rng.Next(-20, 55),
28-
Summary = summaries[rng.Next(summaries.Length)]
29-
}).ToList();
20+
21+
private void Initialize(int quantity)
22+
{
23+
var rng = new Random();
24+
WeatherForecasts = Enumerable.Range(1, quantity).Select(index => new WeatherForecast
25+
{
26+
DateFormatted = DateTime.Now.AddDays(index).ToString("d"),
27+
TemperatureC = rng.Next(-20, 55),
28+
Summary = summaries[rng.Next(summaries.Length)]
29+
}).ToList();
3030
}
3131

3232
public List<WeatherForecast> GetForecasts()
3333
{
3434
return WeatherForecasts;
35-
}
36-
}
37-
}
35+
}
36+
}
37+
}

content/Startup.cs

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
1-
using Microsoft.AspNetCore.Builder;
2-
using Microsoft.AspNetCore.Hosting;
1+
using Microsoft.AspNetCore.Builder;
2+
using Microsoft.AspNetCore.Hosting;
33
using Microsoft.AspNetCore.Mvc;
4-
using Microsoft.AspNetCore.SpaServices.Webpack;
5-
using Microsoft.Extensions.Configuration;
6-
using Microsoft.Extensions.DependencyInjection;
7-
8-
namespace Vue2Spa
9-
{
10-
public class Startup
11-
{
12-
public Startup(IConfiguration configuration)
13-
{
14-
Configuration = configuration;
15-
}
16-
17-
public IConfiguration Configuration { get; }
18-
19-
// This method gets called by the runtime. Use this method to add services to the container.
20-
public void ConfigureServices(IServiceCollection services)
21-
{
22-
// Add framework services.
4+
using Microsoft.AspNetCore.SpaServices.Webpack;
5+
using Microsoft.Extensions.Configuration;
6+
using Microsoft.Extensions.DependencyInjection;
7+
8+
namespace Vue2Spa
9+
{
10+
public class Startup
11+
{
12+
public Startup(IConfiguration configuration)
13+
{
14+
Configuration = configuration;
15+
}
16+
17+
public IConfiguration Configuration { get; }
18+
19+
// This method gets called by the runtime. Use this method to add services to the container.
20+
public void ConfigureServices(IServiceCollection services)
21+
{
22+
// Add framework services.
2323
services.AddMvc()
24-
.SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
25-
26-
// Simple example with dependency injection for a data provider.
27-
services.AddSingleton<Providers.IWeatherProvider, Providers.WeatherProviderFake>();
28-
}
29-
30-
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
31-
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
32-
{
33-
if (env.IsDevelopment())
34-
{
35-
app.UseDeveloperExceptionPage();
36-
37-
// Webpack initialization with hot-reload.
38-
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
39-
{
40-
HotModuleReplacement = true,
41-
});
42-
}
43-
else
44-
{
45-
app.UseExceptionHandler("/Home/Error");
46-
}
47-
48-
app.UseStaticFiles();
49-
50-
app.UseMvc(routes =>
51-
{
52-
routes.MapRoute(
53-
name: "default",
54-
template: "{controller=Home}/{action=Index}/{id?}");
55-
56-
routes.MapSpaFallbackRoute(
57-
name: "spa-fallback",
58-
defaults: new { controller = "Home", action = "Index" });
59-
});
60-
}
61-
}
62-
}
24+
.SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
25+
26+
// Simple example with dependency injection for a data provider.
27+
services.AddSingleton<Providers.IWeatherProvider, Providers.WeatherProviderFake>();
28+
}
29+
30+
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
31+
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
32+
{
33+
if (env.IsDevelopment())
34+
{
35+
app.UseDeveloperExceptionPage();
36+
37+
// Webpack initialization with hot-reload.
38+
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
39+
{
40+
HotModuleReplacement = true,
41+
});
42+
}
43+
else
44+
{
45+
app.UseExceptionHandler("/Home/Error");
46+
}
47+
48+
app.UseStaticFiles();
49+
50+
app.UseMvc(routes =>
51+
{
52+
routes.MapRoute(
53+
name: "default",
54+
template: "{controller=Home}/{action=Index}/{id?}");
55+
56+
routes.MapSpaFallbackRoute(
57+
name: "spa-fallback",
58+
defaults: new { controller = "Home", action = "Index" });
59+
});
60+
}
61+
}
62+
}

0 commit comments

Comments
 (0)