Skip to content

Commit

Permalink
pre-commit| apply mixed-line-endings fix| ANA-1928
Browse files Browse the repository at this point in the history
  • Loading branch information
renefritze committed Apr 30, 2024
1 parent dffad0c commit e334dc4
Show file tree
Hide file tree
Showing 157 changed files with 12,660 additions and 12,660 deletions.
180 changes: 90 additions & 90 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
# This file defines the Oasys formatting style
# The configuration options can be found at:
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html

# We use Google style as a basis and modify where needed
BasedOnStyle: Google

# We group and sort includes based on the Google style...
IncludeCategories:
# We currently need precompiled headers to come before other headers.
# This is because some headers are not properly self-contained and rely
# on the things included/defined in the precompiled header.
# TODO: GSA-6242 - make headers self-contained and remove this include category
- Regex: 'stdafx.h'
Priority: -1
- Regex: 'pch.h'
Priority: -1

# C system headers (more precisely: headers in angle brackets with the .h extension), e.g., <unistd.h>, <stdlib.h>.
- Regex: '^<[^/]*\.h>'
Priority: 2

# C++ standard library headers (without file extension), e.g., <algorithm>, <cstddef>.
- Regex: '^<[a-z_]*>'
Priority: 3

# Other libraries' .h files.
- Regex: '^<.*'
Priority: 4

# Your project's .h files.
- Regex: '.*'
Priority: 5

# We enforce Windows line endings throughout as historically we've had a mix across files
UseCRLF: true
DeriveLineEnding: false

# We use tabs instead of spaces for indentation to minimise change to
# existing code and to allow IDE display flexibility.
IndentWidth: 4

## We maintain access modifier offset as half a full indentation
AccessModifierOffset: -2

# We allow an increased colunm limit as we have 4-character indentation
ColumnLimit: 110

# We use braces on a new line as it better suits our existing code
BreakBeforeBraces: Allman

# We prefer statements to be on a new line so we can easily add break points
AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false

# We always use consistent pointer alignment
DerivePointerAlignment: false

# We always use consistent qualifier alignment
QualifierAlignment: Left

# We put requires clauses on their own line, indented for readability purposes
# (not set by Google config as it predates the feature)
RequiresClausePosition: OwnLine
IndentRequiresClause: true

# We do not want to 'reflow comments' - it tends to make a mess of it
# (especially for commentator documentation, ASCII art, table layouts etc)
ReflowComments: false

# We separate definition blocks to avoid stylistic changes
# coming in amongst other changes in PRs
SeparateDefinitionBlocks: Always

# We include a new line at the end of files for consistency
# and to remove GitHub warning markers
InsertNewlineAtEOF: true

# We always use braces after control statements to avoid
# accidental scope errors and to maintain code consistency
InsertBraces: true

# We remove superfluous semicolons because less code is better
RemoveSemicolon: true

# All our C++ code is compiled with C++20, so we can make
# this assumption here to get more appropriate formatting
Standard: c++20
# This file defines the Oasys formatting style
# The configuration options can be found at:
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html

# We use Google style as a basis and modify where needed
BasedOnStyle: Google

# We group and sort includes based on the Google style...
IncludeCategories:
# We currently need precompiled headers to come before other headers.
# This is because some headers are not properly self-contained and rely
# on the things included/defined in the precompiled header.
# TODO: GSA-6242 - make headers self-contained and remove this include category
- Regex: 'stdafx.h'
Priority: -1
- Regex: 'pch.h'
Priority: -1

# C system headers (more precisely: headers in angle brackets with the .h extension), e.g., <unistd.h>, <stdlib.h>.
- Regex: '^<[^/]*\.h>'
Priority: 2

# C++ standard library headers (without file extension), e.g., <algorithm>, <cstddef>.
- Regex: '^<[a-z_]*>'
Priority: 3

# Other libraries' .h files.
- Regex: '^<.*'
Priority: 4

# Your project's .h files.
- Regex: '.*'
Priority: 5

# We enforce Windows line endings throughout as historically we've had a mix across files
UseCRLF: true
DeriveLineEnding: false

# We use tabs instead of spaces for indentation to minimise change to
# existing code and to allow IDE display flexibility.
IndentWidth: 4

## We maintain access modifier offset as half a full indentation
AccessModifierOffset: -2

# We allow an increased colunm limit as we have 4-character indentation
ColumnLimit: 110

# We use braces on a new line as it better suits our existing code
BreakBeforeBraces: Allman

# We prefer statements to be on a new line so we can easily add break points
AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false

# We always use consistent pointer alignment
DerivePointerAlignment: false

# We always use consistent qualifier alignment
QualifierAlignment: Left

# We put requires clauses on their own line, indented for readability purposes
# (not set by Google config as it predates the feature)
RequiresClausePosition: OwnLine
IndentRequiresClause: true

# We do not want to 'reflow comments' - it tends to make a mess of it
# (especially for commentator documentation, ASCII art, table layouts etc)
ReflowComments: false

# We separate definition blocks to avoid stylistic changes
# coming in amongst other changes in PRs
SeparateDefinitionBlocks: Always

# We include a new line at the end of files for consistency
# and to remove GitHub warning markers
InsertNewlineAtEOF: true

# We always use braces after control statements to avoid
# accidental scope errors and to maintain code consistency
InsertBraces: true

# We remove superfluous semicolons because less code is better
RemoveSemicolon: true

# All our C++ code is compiled with C++20, so we can make
# this assumption here to get more appropriate formatting
Standard: c++20
24 changes: 12 additions & 12 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"CSharpier": {
"version": "0.22.1",
"commands": [
"dotnet-csharpier"
]
}
}
}
{
"version": 1,
"isRoot": true,
"tools": {
"CSharpier": {
"version": "0.22.1",
"commands": [
"dotnet-csharpier"
]
}
}
}
76 changes: 38 additions & 38 deletions AdSec/.NET/AdsToApi/AdsToApi.cs
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
using System;
using Oasys.AdSec;
using Oasys.AdSec.IO.Serialization;
using Oasys.Collections;

namespace AdsToApi
{
/// <summary>
/// This example shows how to convert an .ads file into API objects.
///
/// You might like to run the 'ApiVersion' example first, just to check
/// that the API is installed correctly.
/// </summary>
public static class AdsToApi
{
public static void Main()
{
// Read the required .ads file as string
System.String path =
"..\\..\\..\\..\\..\\..\\..\\DocumentationOnly\\.NET\\DotNetCodeSnippets\\api2section.ads";
System.String json = System.IO.File.ReadAllText(path);

// Use JsonParser's Deserialize method to convert from JSON to API objects
ParsedResult api = JsonParser.Deserialize(json);

// Access the ISection
System.Collections.Generic.IList<ISection> api_sections = api.Sections;
ISection section_one = api_sections[0];

// Access and print warnings to check for warning messages while converting JSON to API
System.Collections.Generic.IList<IWarning> api_warnings = api.Warnings;
for (int i = 0; i < api_warnings.Count; i++)
{
Console.WriteLine(api_warnings[i].Description);
}
}
}
}
using System;
using Oasys.AdSec;
using Oasys.AdSec.IO.Serialization;
using Oasys.Collections;

namespace AdsToApi
{
/// <summary>
/// This example shows how to convert an .ads file into API objects.
///
/// You might like to run the 'ApiVersion' example first, just to check
/// that the API is installed correctly.
/// </summary>
public static class AdsToApi
{
public static void Main()
{
// Read the required .ads file as string
System.String path =
"..\\..\\..\\..\\..\\..\\..\\DocumentationOnly\\.NET\\DotNetCodeSnippets\\api2section.ads";
System.String json = System.IO.File.ReadAllText(path);

// Use JsonParser's Deserialize method to convert from JSON to API objects
ParsedResult api = JsonParser.Deserialize(json);

// Access the ISection
System.Collections.Generic.IList<ISection> api_sections = api.Sections;
ISection section_one = api_sections[0];

// Access and print warnings to check for warning messages while converting JSON to API
System.Collections.Generic.IList<IWarning> api_warnings = api.Warnings;
for (int i = 0; i < api_warnings.Count; i++)
{
Console.WriteLine(api_warnings[i].Description);
}
}
}
}
32 changes: 16 additions & 16 deletions AdSec/.NET/AdsToApi/AdsToApi.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AdSec" Version="2.0.0.21" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AdSec" Version="2.0.0.21" />
</ItemGroup>

</Project>
Loading

0 comments on commit e334dc4

Please sign in to comment.