SA1649 revisited

May 17, 2011 at 11:48 PM

I have another SA1649 question. I get the following style cop error:

SA1649: The file attribute in the file header's copyright tag must contain the name of the first type in the file.    ...\ObjectConstructor.cs   

ObjectConstructor.cs  is as follows:

// <copyright file="ObjectConstructor.cs" company="James Newton-King">
// Copyright (c) 2007 All Right Reserved
// </copyright>

#region License
// Copyright (c) 2007 James Newton-King
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
#endregion

namespace Newtonsoft.Json.Serialization
{
  /// <summary>
  /// Represents a method that constructs an object.
  /// </summary>
  /// <typeparam name="T">Type ???</typeparam>
  /// <param name="args">The args.</param>
  /// <returns>Delegate ???</returns>
  /// <remarks>awaiting remarks</remarks>
  public delegate object ObjectConstructor<T>(params object[] args);
}

Coordinator
May 17, 2011 at 11:54 PM

ObjectConstructor{T}.cs

May 18, 2011 at 1:13 PM

Thank you! It would be helpful if SA1649, displayed the expected file name.

The following is in class MethodCall{T, TResult}.cs, but still gets the message:     SA1649: The file attribute in the file header's copyright tag must contain the name of the first type in the file.    E:\VS2010\JSON.NET\Json40r2\Newtonsoft.Json\Utilities\MethodCall{T, TResult}.cs    1    1   

// <copyright file="MethodCall{T, TResult}.cs" company="James Newton-King">
// Copyright (c) 2007 All Right Reserved
// </copyright>

#region License
// Copyright (c) 2007 James Newton-King
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
#endregion

namespace Newtonsoft.Json.Utilities
{
  /// <summary>
  /// Method Call
  /// </summary>
  /// <typeparam name="T">Type of ??</typeparam>
  /// <typeparam name="TResult">The type of the T result.</typeparam>
  /// <param name="target">The target.</param>
  /// <param name="args">The arguments.</param>
  /// <returns>Method Call for T</returns>
  /// <remarks>awaiting remarks</remarks>
  internal delegate TResult MethodCall<T, TResult>(T target, params object[] args);
}

Coordinator
May 18, 2011 at 4:29 PM

No space in the header text. Like "MethodCall{T,TResult}.cs". I'll have it display what would be ok.

May 18, 2011 at 4:37 PM

Thank you again! I look forward the next version of StyleCop!

May 22, 2011 at 10:45 PM
andyr wrote:

No space in the header text. Like "MethodCall{T,TResult}.cs". I'll have it display what would be ok.

StyleCop 4.5 (build 4.5.16.0) does have this duisplay - thank you!