Skip to content

Commit 54cde17

Browse files
committed
Add missing copyright headers in source files
This change adds missing copy right headers in all new source files. It also introduces a new script, AddCopyrightHeaders.ps1, that automates the process of adding a copyright header to files which do not have one.
1 parent ff48fd5 commit 54cde17

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+446
-65
lines changed

PowerShellEditorServices.sln

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.31101.0
4+
VisualStudioVersion = 12.0.40629.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F594E7FD-1E72-4E51-A496-B019C2BA3180}"
77
EndProject
@@ -34,6 +34,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{E51470
3434
EndProject
3535
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices.Test.Shared", "test\PowerShellEditorServices.Test.Shared\PowerShellEditorServices.Test.Shared.csproj", "{6A20B9E9-DE66-456E-B4F5-ACFD1A95C3CA}"
3636
EndProject
37+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{E2316F5C-A551-4A8D-8103-E42CA6D757E2}"
38+
ProjectSection(SolutionItems) = preProject
39+
scripts\AddCopyrightHeaders.ps1 = scripts\AddCopyrightHeaders.ps1
40+
EndProjectSection
41+
EndProject
3742
Global
3843
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3944
Debug|Any CPU = Debug|Any CPU

scripts/AddCopyrightHeaders.ps1

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Copyright (c) Microsoft. All rights reserved.
3+
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
#
5+
6+
$copyrightHeaderString =
7+
@'
8+
//
9+
// Copyright (c) Microsoft. All rights reserved.
10+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
11+
//
12+
'@
13+
14+
$srcPath = Resolve-Path $PSScriptRoot\..\src
15+
Push-Location $srcPath
16+
17+
$updateCount = 0;
18+
$allSourceFiles = Get-ChildItem $srcPath -Recurse -Filter *.cs | ?{ $_.FullName -notmatch "\\obj\\?" }
19+
20+
foreach ($sourceFile in $allSourceFiles)
21+
{
22+
$fileContent = (Get-Content $sourceFile.FullName -Raw).TrimStart()
23+
24+
if ($fileContent.StartsWith($copyrightHeaderString) -eq $false)
25+
{
26+
# Add the copyright header to the file
27+
Set-Content $sourceFile.FullName ($copyrightHeaderString + "`r`n`r`n" + $fileContent)
28+
Write-Output ("Updated {0}" -f (Resolve-Path $sourceFile.FullName -Relative))
29+
}
30+
}
31+
32+
Write-Output "`r`nDone, $updateCount files updated."
33+
34+
Pop-Location

src/PowerShellEditorServices.Host/Properties/AssemblyInfo.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using System.Reflection;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using System.Reflection;
27
using System.Runtime.CompilerServices;
38
using System.Runtime.InteropServices;
49

@@ -10,7 +15,7 @@
1015
[assembly: AssemblyConfiguration("")]
1116
[assembly: AssemblyCompany("Microsoft")]
1217
[assembly: AssemblyProduct("Windows PowerShell Editor Services")]
13-
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
18+
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
1419
[assembly: AssemblyTrademark("")]
1520
[assembly: AssemblyCulture("")]
1621

@@ -35,3 +40,4 @@
3540
[assembly: AssemblyVersion("0.0.0.0")]
3641
[assembly: AssemblyFileVersion("0.0.0.0")]
3742
[assembly: AssemblyInformationalVersion("0.0.0.0")]
43+

src/PowerShellEditorServices.Transport.Stdio/Event/ExitedEvent.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
27

38
namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Event
49
{
@@ -12,3 +17,4 @@ public class ExitedEventBody
1217
public int ExitCode { get; set; }
1318
}
1419
}
20+
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
27

38
namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Event
49
{
510
[MessageTypeName("initialized")]
611
public class InitializedEvent : EventBase<object>
712
{
813
}
9-
}
14+
}

src/PowerShellEditorServices.Transport.Stdio/Event/StoppedEvent.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
27
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Model;
38

49
namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Event
@@ -32,3 +37,4 @@ public class StoppedEventBody
3237
public string Text { get; set; }
3338
}
3439
}
40+
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
27

38
namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Event
49
{
@@ -7,3 +12,4 @@ public class TerminatedEvent : EventBase<object>
712
{
813
}
914
}
15+

src/PowerShellEditorServices.Transport.Stdio/Message/MessageType.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-

1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
26
namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Message
37
{
48
/// <summary>
@@ -28,3 +32,4 @@ public enum MessageType
2832
}
2933

3034
}
35+

src/PowerShellEditorServices.Transport.Stdio/Model/Breakpoint.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using System;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using System;
27
using System.Collections.Generic;
38
using System.Linq;
49
using System.Text;
@@ -27,3 +32,4 @@ public static Breakpoint Create(
2732
}
2833
}
2934
}
35+

src/PowerShellEditorServices.Transport.Stdio/Model/Message.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using System.Collections.Generic;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using System.Collections.Generic;
27

38
namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Model
49
{
@@ -15,3 +20,4 @@ public class Message
1520
public Dictionary<string, string> Variables { get; set; }
1621
}
1722
}
23+

src/PowerShellEditorServices.Transport.Stdio/Model/Scope.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using System;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using System;
27
using System.Collections.Generic;
38
using System.Linq;
49
using System.Text;
@@ -30,3 +35,4 @@ public static Scope Create(VariableScope scope)
3035
}
3136
}
3237
}
38+

src/PowerShellEditorServices.Transport.Stdio/Model/Source.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-

1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
26
namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Model
37
{
48
public class Source
@@ -10,3 +14,4 @@ public class Source
1014
public int? SourceReference { get; set; }
1115
}
1216
}
17+

src/PowerShellEditorServices.Transport.Stdio/Model/StackFrame.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-

1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
26
namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Model
37
{
48
public class StackFrame
@@ -44,3 +48,4 @@ public static StackFrame Create(
4448
}
4549
}
4650
}
51+

src/PowerShellEditorServices.Transport.Stdio/Model/Thread.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-

1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
26
namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Model
37
{
48
public class Thread
@@ -8,3 +12,4 @@ public class Thread
812
public string Name { get; set; }
913
}
1014
}
15+

src/PowerShellEditorServices.Transport.Stdio/Model/Variable.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-

1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
26
namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Model
37
{
48
public class Variable
@@ -24,3 +28,4 @@ public static Variable Create(VariableDetails variable)
2428
}
2529
}
2630
}
31+

src/PowerShellEditorServices.Transport.Stdio/Properties/AssemblyInfo.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using System.Reflection;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using System.Reflection;
27
using System.Runtime.CompilerServices;
38
using System.Runtime.InteropServices;
49

@@ -10,7 +15,7 @@
1015
[assembly: AssemblyConfiguration("")]
1116
[assembly: AssemblyCompany("Microsoft")]
1217
[assembly: AssemblyProduct("Windows PowerShell Editor Services")]
13-
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
18+
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
1419
[assembly: AssemblyTrademark("")]
1520
[assembly: AssemblyCulture("")]
1621

@@ -35,3 +40,4 @@
3540
[assembly: AssemblyVersion("0.0.0.0")]
3641
[assembly: AssemblyFileVersion("0.0.0.0")]
3742
[assembly: AssemblyInformationalVersion("0.0.0.0")]
43+

src/PowerShellEditorServices.Transport.Stdio/Request/AttachRequest.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
27
using System.Threading.Tasks;
38

49
namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Request
@@ -21,3 +26,4 @@ public class AttachRequestArguments
2126
public int Port { get; set; }
2227
}
2328
}
29+

src/PowerShellEditorServices.Transport.Stdio/Request/ContinueRequest.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
27
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Response;
38
using Nito.AsyncEx;
49
using System.Threading.Tasks;
@@ -20,3 +25,4 @@ await messageWriter.WriteMessage(
2025
}
2126
}
2227
}
28+

src/PowerShellEditorServices.Transport.Stdio/Request/DisconnectRequest.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
27
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Response;
38
using Nito.AsyncEx;
49
using System;
@@ -35,3 +40,4 @@ public override Task ProcessMessage(
3540
}
3641
}
3742
}
43+

src/PowerShellEditorServices.Transport.Stdio/Request/EvaluateRequest.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
27
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Response;
38
using Nito.AsyncEx;
49
using System.Threading.Tasks;
@@ -49,3 +54,4 @@ public class EvaluateRequestArguments
4954
public int FrameId { get; set; }
5055
}
5156
}
57+

src/PowerShellEditorServices.Transport.Stdio/Request/InitializeRequest.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Event;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Event;
27
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
38
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Response;
49
using Microsoft.PowerShell.EditorServices.Utility;
@@ -43,4 +48,4 @@ public class InitializeRequestArguments
4348

4449
public string GeneratedCodeDirectory { get; set; }
4550
}
46-
}
51+
}

src/PowerShellEditorServices.Transport.Stdio/Request/LaunchRequest.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Event;
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Event;
27
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
38
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Response;
49
using Microsoft.PowerShell.EditorServices.Utility;
@@ -61,3 +66,4 @@ public class LaunchRequestArguments
6166
public Dictionary<string, string> EnvironmentVariables { get; set; }
6267
}
6368
}
69+

0 commit comments

Comments
 (0)