Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copyright dotnet #13522

Merged
merged 3 commits into from
Nov 7, 2024
Merged

Copyright dotnet #13522

merged 3 commits into from
Nov 7, 2024

Conversation

titusfortner
Copy link
Member

Status

I did not see any files that had other copyright info at the top or anything that should be excluded from these changes.

Description

  • Update copyright script to work for cs files:
    • Add file name and copyright tags at top and bottom (requires turning properties into methods to pass file name)
    • Change encoding to prevent "Zero Width No-Break Space" characters
    • Makes sure there is a '\n' after the copyright if one does not exist
    • Removes trailing white space on lines while we're at it
  • Fixes .cs files
    • None of the test files and a few of the recently added files did not include copyright at all
    • Several files were missing the closing copyright tag
    • Several files were misnamed (copy/paste errors)

Motivation and Context

Bring .NET in line with all the other languages

@nvborisenko
Copy link
Member

I would prefer using .editorconfig file. Then everybody (not only you equipped with py script), can write some code satisfying project rules.

Moreover, then we can include dotnet format command as a part of CI Format script.

@titusfortner
Copy link
Member Author

There is a bazel command for it, too! 😜

It's been added into the format script, so it will fail RBE test like everything else that isn't properly formatted, and the fix, like other things in the project will be to run ./scripts/format.sh and commit the changes.

I'm not opposed to having editorconfig, but someone has to write it. 😄

@nvborisenko nvborisenko self-requested a review March 13, 2024 22:38
Copy link
Member

@nvborisenko nvborisenko left a comment

Choose a reason for hiding this comment

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

Go ahead, please don't forget to resolve conflicts and verify newly added files with old copyright notice.

@nvborisenko
Copy link
Member

nvborisenko commented Mar 15, 2024

Ah, we already have .editorconfig file.

I have added the following there:

[*.cs]
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
file_header_template = <copyright file="{fileName}" company="Selenium Committers">\nLicensed to the Software Freedom Conservancy (SFC) under one\nor more contributor license agreements.  See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership.  The SFC licenses this file\nto you under the Apache License, Version 2.0 (the\n"License"); you may not use this file except in compliance\nwith the License.  You may obtain a copy of the License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the License is distributed on an\n"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied.  See the License for the\nspecific language governing permissions and limitations\nunder the License.\n</copyright>

Works good, but ; symbol breaks everything. I tried escaping it in many ways - no results.

image

Copy link

@A1exKH A1exKH left a comment

Choose a reason for hiding this comment

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

LGTM.

# Conflicts:
#	dotnet/src/webdriver/DevTools/DevToolsExtensionMethods.cs
#	dotnet/src/webdriver/DevTools/v128/V128Domains.cs
#	dotnet/src/webdriver/DevTools/v128/V128JavaScript.cs
#	dotnet/src/webdriver/DevTools/v128/V128Log.cs
#	dotnet/src/webdriver/DevTools/v128/V128Network.cs
#	dotnet/src/webdriver/DevTools/v128/V128Target.cs
#	dotnet/src/webdriver/DevTools/v129/V129Domains.cs
#	dotnet/src/webdriver/DevTools/v129/V129JavaScript.cs
#	dotnet/src/webdriver/DevTools/v129/V129Log.cs
#	dotnet/src/webdriver/DevTools/v129/V129Network.cs
#	dotnet/src/webdriver/DevTools/v129/V129Target.cs
#	dotnet/src/webdriver/DevTools/v130/V130Domains.cs
#	dotnet/src/webdriver/DevTools/v130/V130JavaScript.cs
#	dotnet/src/webdriver/DevTools/v130/V130Log.cs
#	dotnet/src/webdriver/DevTools/v130/V130Network.cs
#	dotnet/src/webdriver/DevTools/v130/V130Target.cs
#	dotnet/src/webdriver/DriverOptionsMergeResult.cs
#	dotnet/test/chrome/ChromeSpecificTests.cs
#	dotnet/test/common/AlertsTest.cs
#	dotnet/test/common/AssemblyFixture.cs
#	dotnet/test/common/ClickScrollingTest.cs
#	dotnet/test/common/ClickTest.cs
#	dotnet/test/common/CookieImplementationTest.cs
#	dotnet/test/common/CookieTest.cs
#	dotnet/test/common/CorrectEventFiringTest.cs
#	dotnet/test/common/CustomTestAttributes/NeedsFreshDriverAttribute.cs
#	dotnet/test/common/DevTools/DevToolsConsoleTest.cs
#	dotnet/test/common/DevTools/DevToolsLogTest.cs
#	dotnet/test/common/DevTools/DevToolsNetworkTest.cs
#	dotnet/test/common/DevTools/DevToolsPerformanceTest.cs
#	dotnet/test/common/DevTools/DevToolsProfilerTest.cs
#	dotnet/test/common/DevTools/DevToolsSecurityTest.cs
#	dotnet/test/common/DevTools/DevToolsTargetTest.cs
#	dotnet/test/common/ElementAttributeTest.cs
#	dotnet/test/common/ElementFindingTest.cs
#	dotnet/test/common/ElementPropertyTest.cs
#	dotnet/test/common/Environment/InlinePage.cs
#	dotnet/test/common/Environment/TestWebServerConfig.cs
#	dotnet/test/common/Environment/UrlBuilder.cs
#	dotnet/test/common/ExecutingAsyncJavascriptTest.cs
#	dotnet/test/common/ExecutingJavascriptTest.cs
#	dotnet/test/common/FormHandlingTests.cs
#	dotnet/test/common/FrameSwitchingTest.cs
#	dotnet/test/common/GetLogsTest.cs
#	dotnet/test/common/ImplicitWaitTest.cs
#	dotnet/test/common/Interactions/ActionBuilderTest.cs
#	dotnet/test/common/Interactions/BasicMouseInterfaceTest.cs
#	dotnet/test/common/Interactions/BasicWheelInterfaceTest.cs
#	dotnet/test/common/Interactions/DragAndDropTest.cs
#	dotnet/test/common/JavascriptEnabledBrowserTest.cs
#	dotnet/test/common/NavigationTest.cs
#	dotnet/test/common/NetworkInterceptionTests.cs
#	dotnet/test/common/PageLoadingTest.cs
#	dotnet/test/common/PositionAndSizeTest.cs
#	dotnet/test/common/ProxySettingTest.cs
#	dotnet/test/common/ProxyTest.cs
#	dotnet/test/common/SelectElementHandlingTest.cs
#	dotnet/test/common/SessionHandlingTest.cs
#	dotnet/test/common/ShadowRootHandlingTest.cs
#	dotnet/test/common/SlowLoadingPageTest.cs
#	dotnet/test/common/StubDriver.cs
#	dotnet/test/common/SvgElementTest.cs
#	dotnet/test/common/TakesScreenshotTest.cs
#	dotnet/test/common/TargetLocatorTest.cs
#	dotnet/test/common/TextHandlingTest.cs
#	dotnet/test/common/TypingTest.cs
#	dotnet/test/common/VirtualAuthn/VirtualAuthenticatorTest.cs
#	dotnet/test/common/VisibilityTest.cs
#	dotnet/test/common/WindowSwitchingTest.cs
#	dotnet/test/common/WindowTest.cs
#	dotnet/test/edge/AssemblyTeardown.cs
#	dotnet/test/firefox/AssemblyTeardown.cs
#	dotnet/test/firefox/FirefoxDriverTest.cs
#	dotnet/test/firefox/FirefoxProfileTests.cs
#	dotnet/test/ie/AssemblyTeardown.cs
#	dotnet/test/remote/AssemblyTeardown.cs
#	dotnet/test/remote/ChromeRemoteWebDriver.cs
#	dotnet/test/remote/EdgeRemoteWebDriver.cs
#	dotnet/test/remote/FirefoxRemoteWebDriver.cs
#	dotnet/test/remote/RemoteSessionCreationTests.cs
#	dotnet/test/remote/RemoteWebDriverSpecificTests.cs
#	dotnet/test/remote/TestInternetExplorerRemoteWebDriver.cs
#	dotnet/test/support/Events/EventFiringWebDriverTest.cs
#	dotnet/test/support/Extensions/ExecuteJavaScriptTest.cs
#	dotnet/test/support/UI/DefaultWaitTest.cs
#	dotnet/test/support/UI/FakeClock.cs
#	dotnet/test/support/UI/LoadableComponentTests.cs
#	dotnet/test/support/UI/PopupWindowFinderTest.cs
#	dotnet/test/support/UI/SelectBrowserTests.cs
#	dotnet/test/support/UI/SelectTests.cs
#	dotnet/test/support/UI/SlowLoadableComponentTest.cs
#	dotnet/test/support/UI/WebDriverWaitTest.cs
@VietND96 VietND96 merged commit 7540e09 into trunk Nov 7, 2024
10 checks passed
@VietND96 VietND96 deleted the copyright_dotnet branch November 7, 2024 22:43
@VietND96
Copy link
Member

VietND96 commented Nov 7, 2024

Merged the PR based on reviewers approval and CI passed.

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.

4 participants