Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Disable IDE0073: FileHeaderMismatch#13935

Closed
xtqqczze wants to merge 2 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
xtqqczze:disable-IDE0073xtqqczze/PowerShell-PowerShell:disable-IDE0073Copy head branch name to clipboard
Closed

Disable IDE0073: FileHeaderMismatch#13935
xtqqczze wants to merge 2 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
xtqqczze:disable-IDE0073xtqqczze/PowerShell-PowerShell:disable-IDE0073Copy head branch name to clipboard

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Oct 29, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

@iSazonov Can you merge?

@iSazonov

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

Reopen the PR to restart all CIs.

@iSazonov iSazonov reopened this Oct 30, 2020
@xtqqczze

xtqqczze commented Oct 30, 2020

Copy link
Copy Markdown
Contributor Author

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

@xtqqczze

Copy link
Copy Markdown
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
Copy Markdown
Collaborator

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

@xtqqczze

Copy link
Copy Markdown
Contributor Author

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

@xtqqczze

xtqqczze commented Nov 1, 2020

Copy link
Copy Markdown
Contributor Author

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.