Skip to content

Conversation

@xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Oct 29, 2020

Various files do not match the file_header_template in root EditorConfig:
Copyright (c) Microsoft Corporation.\nLicensed under the MIT License.

For example, src\System.Management.Automation\engine\interpreter\InstructionList.cs uses Apache License.

This PR sets the rule severity to suggestion.

@ghost ghost assigned iSazonov Oct 29, 2020
@xtqqczze
Copy link
Contributor Author

@iSazonov Can you merge?

@iSazonov
Copy link
Collaborator

No, we should inform users to use right header. We need to set "suggestion". Or we could suppress the rule for some files/folders.

@xtqqczze
Copy link
Contributor Author

@iSazonov We cannot use directory based suppression, at least for src\System.Management.Automation\engine\interpreter\ as there are files with different licenses present in the same directory.

For suggestion severity, I worry that it would be too easy for a contributor to accidentally accept a light bulb recommendation in an existing file, resulting in a change in the license header! If we were to set suggestion, I would want maintainer review of this change.

@iSazonov
Copy link
Collaborator

For suggestion severity, I worry that it would be too easy for a contributor to accidentally accept a light bulb recommendation in an existing file, resulting in a change in the license header!

It is not problem. We have some files from other repositories with different licenses and the files are frozen. We know about this. So "suggestion" is good compromise.

@xtqqczze xtqqczze changed the title Silence IDE0073: FileHeaderMismatch Disable IDE0073: FileHeaderMismatch Oct 30, 2020
@xtqqczze
Copy link
Contributor Author

For suggestion severity, I worry that it would be too easy for a contributor to accidentally accept a light bulb recommendation in an existing file, resulting in a change in the license header!

It is not problem. We have some files from other repositories with different licenses and the files are frozen. We know about this. So "suggestion" is good compromise.

OK

@xtqqczze
Copy link
Contributor Author

@iSazonov Are there any options for suppression on a per file basis, other than the following?

#pragma warning disable IDE0073 // The file header does not match the required text
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#pragma warning restore IDE0073 // The file header does not match the required text

The example above is for the file: src\System.Management.Automation\engine\ComInterop\ArgBuilder.cs.

@iSazonov
Copy link
Collaborator

@xtqqczze The case is so rare and not critical so we can use "suggestion" without any concerns - maintainer will review and ensure.

@iSazonov iSazonov closed this Oct 30, 2020
@iSazonov
Copy link
Collaborator

Reopen the PR to restart all CIs.

@iSazonov iSazonov reopened this Oct 30, 2020
@xtqqczze
Copy link
Contributor Author

xtqqczze commented Oct 30, 2020

Build failures are due to PowerShell Gallery unavailability, see #13946.

@xtqqczze
Copy link
Contributor Author

closing and reopening to restart tests

@xtqqczze xtqqczze closed this Oct 31, 2020
@xtqqczze xtqqczze reopened this Oct 31, 2020
@iSazonov
Copy link
Collaborator

I wonder before the change we have "warning" but build does not fail.

@xtqqczze
Copy link
Contributor Author

It appears that IDE0073 is only triggering in live analysis, not in build. We need to set MSBuild property EnforceCodeStyleInBuild.

@xtqqczze
Copy link
Contributor Author

xtqqczze commented Nov 1, 2020

Change was merged in #13957.

@xtqqczze xtqqczze closed this Nov 1, 2020
@xtqqczze xtqqczze deleted the disable-IDE0073 branch November 1, 2020 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants