Skip to content

Conversation

@codemzs
Copy link
Member

@codemzs codemzs commented May 2, 2019

In addition to #3645, I wrote a small C# program to open every ".cs" file in src directory and read the first non-null/empty line and compare it against "// Licensed to the .NET Foundation under one or more agreements." and found few more places where license was missing.

public static class Program
    {
        public static void Main(string[] args) => RunAll(@"E:\machinelearning\src");

        internal static void RunAll(string sDir)
        {
           foreach (string d in Directory.GetDirectories(sDir))
            {
                foreach (string f in Directory.GetFiles(d))
                {
                    if (Path.GetExtension(f) == ".cs" || Path.GetExtension(f) == ".tt")
                    {
                        using (var fileStream = File.OpenRead(f))
                        using (var streamReader = new StreamReader(fileStream, Encoding.UTF8, true))
                        {
                            string line;
                            while ((line = streamReader.ReadLine()) != null)
                            {
                                if(String.IsNullOrEmpty(line))
                                    continue;

                                if (line !=
                                    @"// Licensed to the .NET Foundation under one or more agreements.")
                                {
                                    Console.WriteLine(f + " : " + line);
                                }

                                break;

                            }
                        }
                    }
                }
                RunAll(d);
            }
        }
    }

@codemzs codemzs requested a review from eerhardt May 2, 2019 18:40
@codecov
Copy link

codecov bot commented May 2, 2019

Codecov Report

Merging #3651 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3651   +/-   ##
=======================================
  Coverage   72.78%   72.78%           
=======================================
  Files         808      808           
  Lines      145588   145588           
  Branches    16250    16250           
=======================================
  Hits       105960   105960           
- Misses      35204    35205    +1     
+ Partials     4424     4423    -1
Flag Coverage Δ
#Debug 72.78% <ø> (ø) ⬆️
#production 68.28% <ø> (ø) ⬆️
#test 89.03% <ø> (ø) ⬆️
Impacted Files Coverage Δ
...c/Microsoft.ML.FastTree/Utils/BufferPoolManager.cs 0% <ø> (ø) ⬆️
...icrosoft.ML.TensorFlow/TensorFlow/TensorGeneric.cs 44.21% <ø> (ø) ⬆️
src/Microsoft.ML.Transforms/Text/LdaTransform.cs 89.26% <0%> (-0.63%) ⬇️
...StandardTrainers/Standard/LinearModelParameters.cs 60.31% <0%> (+0.26%) ⬆️
src/Microsoft.ML.Maml/MAML.cs 26.21% <0%> (+1.45%) ⬆️

@codemzs codemzs requested a review from natke May 2, 2019 19:28
Copy link
Member

@ganik ganik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@codemzs codemzs merged commit 6ebfeb3 into dotnet:master May 2, 2019
@eerhardt eerhardt deleted the samplescleanup2 branch May 2, 2019 19:49
@ghost ghost locked as resolved and limited conversation to collaborators Mar 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants