Skip to content

Commit

Permalink
Merge branch 'master' of github.com:PowerShell/PowerShell into pwshw
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveL-MSFT committed Jul 29, 2020
2 parents d906364 + 49e432d commit 90cb59e
Show file tree
Hide file tree
Showing 2,012 changed files with 42,140 additions and 23,490 deletions.
28 changes: 28 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,52 @@ update_configs:
update_schedule: "live"
default_labels:
- "CL-BuildPackaging"
ignored_updates:
- match:
dependency_name: "System.*"
- match:
dependency_name: "Microsoft.Win32.Registry.AccessControl"
- match:
dependency_name: "Microsoft.Windows.Compatibility"

- package_manager: "dotnet:nuget"
directory: "/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility"
update_schedule: "live"
default_labels:
- "CL-BuildPackaging"
ignored_updates:
- match:
dependency_name: "System.*"
- match:
dependency_name: "Microsoft.Win32.Registry.AccessControl"
- match:
dependency_name: "Microsoft.Windows.Compatibility"

- package_manager: "dotnet:nuget"
directory: "/tools/packaging/projects/reference/System.Management.Automation"
update_schedule: "live"
default_labels:
- "CL-BuildPackaging"
ignored_updates:
- match:
dependency_name: "System.*"
- match:
dependency_name: "Microsoft.Win32.Registry.AccessControl"
- match:
dependency_name: "Microsoft.Windows.Compatibility"

- package_manager: "dotnet:nuget"
directory: "/test/tools/Modules"
update_schedule: "live"
default_labels:
- "CL-BuildPackaging"
ignored_updates:
- match:
dependency_name: "System.*"
- match:
dependency_name: "Microsoft.Win32.Registry.AccessControl"
- match:
dependency_name: "Microsoft.Windows.Compatibility"

- package_manager: "dotnet:nuget"
directory: "/src/Modules"
Expand Down
6 changes: 3 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM mcr.microsoft.com/dotnet/core/sdk:3.1.100-preview1
FROM mcr.microsoft.com/dotnet/nightly/sdk:5.0.100-preview.7

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -13,7 +13,7 @@ RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
#
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
&& apt-get -y install git procps lsb-release \
&& apt-get -y install --no-install-recommends git procps lsb-release \
#
# Clean up
&& apt-get autoremove -y \
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"name": ".NET Core 3.1, including pwsh (Debian 10)",
"name": ".NET Core 5.0, including pwsh (Debian 10)",
"dockerFile": "Dockerfile",

// Uncomment the next line to run commands after the container is created.
"postCreateCommand": "cd src/powershell-unix && dotnet restore",

"extensions": [
"ms-azure-devops.azure-pipelines",
"ms-vscode.csharp",
"ms-dotnettools.csharp",
"ms-vscode.powershell",
"DavidAnson.vscode-markdownlint",
"vitaliymaz.vscode-svg-previewer"
Expand Down
10 changes: 10 additions & 0 deletions .devcontainer/fedora30/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM mcr.microsoft.com/powershell:preview-fedora-30

# Configure apt and install packages
RUN dnf install -y git procps wget findutils \
&& dnf clean all
16 changes: 16 additions & 0 deletions .devcontainer/fedora30/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"name": "Fedora 30",
"dockerFile": "Dockerfile",

// Uncomment the next line to run commands after the container is created.
"postCreateCommand": "pwsh -c 'import-module ./build.psm1;start-psbootstrap'",

"extensions": [
"ms-azure-devops.azure-pipelines",
"ms-dotnettools.csharp",
"ms-vscode.powershell",
"DavidAnson.vscode-markdownlint",
"vitaliymaz.vscode-svg-previewer"
]
}
60 changes: 48 additions & 12 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,55 @@
# .NET coding convention settings for EditorConfig
# https://docs.microsoft.com/visualstudio/ide/editorconfig-code-style-settings-reference
#
# The .editorconfig comes from Roslyn and CoreFX repositories:
# https://github.com/dotnet/corefx/blob/master/.editorconfig
# This file comes from dotnet repositories:
# https://github.com/dotnet/runtime/blob/master/.editorconfig
# https://github.com/dotnet/roslyn/blob/master/.editorconfig

# Top-most EditorConfig file
root = true

# Don't use tabs for indentation.
[*]
charset = utf-8
# indent_size intentionally not specified in this section
indent_style = space
# (Please don't specify an indent_size here; that has too many unintended consequences.)
insert_final_newline = true

# Code files
[*.{cs,csx,cpp,h}]
# Source code
[*.{cs,ps1,psd1,psm1}]
indent_size = 4

# Shell scripts
[*.sh]
indent_size = 4
insert_final_newline = true
charset = utf-8

# Xml project files
[*.{csproj,resx,ps1xml}]
indent_size = 2

# JSON files
[*.json]
# Data serialization
[*.{json,yaml,yml}]
indent_size = 2

# Markdown
[*.md]
indent_size = 2

# Xml files
[*.{xml,stylecop,resx,ruleset}]
[*.{resx,ruleset,stylecop,xml,xsd,xsl}]
indent_size = 2

# Xml config files
[*.{props,targets,config,nuspec}]
indent_size = 2

# Dotnet code style settings:
[*.{cs,cpp}]
[*.cs]
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true

# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion

# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
Expand Down Expand Up @@ -68,6 +78,7 @@ dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_sty

dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected

dotnet_naming_style.static_prefix_style.required_prefix = s_
dotnet_naming_style.static_prefix_style.capitalization = camel_case
Expand All @@ -89,17 +100,38 @@ dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_readonly_field = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_auto_properties = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion

dotnet_code_quality_unused_parameters = non_public:suggestion

# CSharp code style settings:
[*.cs]

csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false
csharp_prefer_braces = true:silent

csharp_prefer_static_local_function = true:suggestion
csharp_prefer_simple_using_statement = false:none
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_prefer_range_operator = false:none
csharp_style_prefer_index_operator = false:none
csharp_style_pattern_local_over_anonymous_function = false:none

csharp_using_directive_placement = outside_namespace:suggestion

# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current

Expand All @@ -108,6 +140,9 @@ csharp_style_var_for_built_in_types = false:none
csharp_style_var_when_type_is_apparent = false:none
csharp_style_var_elsewhere = false:suggestion

# Expression-bodied members
csharp_style_expression_bodied_local_functions = true:silent

# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_constructors = false:none
Expand Down Expand Up @@ -156,3 +191,4 @@ csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ src/Microsoft.PowerShell.Commands.Management/ @daxian-dbw @adityapatwardhan
src/Microsoft.PowerShell.Commands.Utility/ @JamesWTruher @PaulHigin

# Area: Console
src/Microsoft.PowerShell.ConsoleHost/ @daxian-dbw @anmenaga
src/Microsoft.PowerShell.ConsoleHost/ @daxian-dbw @anmenaga @TylerLeonhardt

# Area: Demos
demos/ @joeyaiello @SteveL-MSFT @HemantMahawar
Expand Down
44 changes: 23 additions & 21 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ Please read the rest of this document to ensure a smooth contribution process.

## Quick Start Checklist

* Review the [Contribution License Agreement][CLA] requirement.
* Review the [Contributor License Agreement][CLA] requirement.
* Get familiar with the [PowerShell repository](../docs/git).

## Contributing to Issues

* Review [Issue Management][issue-management].
* Check if the issue you are going to file already exists in our [GitHub issues][open-issue].
* If you can't find your issue already,
[open a new issue](https://github.com/PowerShell/PowerShell/issues/new),
[open a new issue](https://github.com/PowerShell/PowerShell/issues/new/choose),
making sure to follow the directions as best you can.
* If the issue is marked as [`Up-for-Grabs`][up-for-grabs],
the PowerShell Maintainers are looking for help with the issue.
Expand Down Expand Up @@ -115,7 +115,7 @@ Please see [Building PowerShell](../README.md#building-the-repository).

#### Testing PowerShell

Please see PowerShell [Testing Guidelines - Running Tests Outside of CI][running-tests-outside-of-ci] on how to test you build locally.
Please see PowerShell [Testing Guidelines - Running Tests Outside of CI][running-tests-outside-of-ci] on how to test your build locally.

### Finding or creating an issue

Expand Down Expand Up @@ -167,11 +167,11 @@ Additional references:
An issue title is to briefly describe what is wrong, while a PR title is to briefly describe what is changed.
A better example is: "Add Ensure parameter to New-Item cmdlet", with "Fix #5" in the PR's body.
* When you create a pull request,
including a summary about your changes in the PR description.
include a summary about your changes in the PR description.
The description is used to create change logs,
so try to have the first sentence explain the benefit to end users.
If the changes are related to an existing GitHub issue,
please reference the issue in PR description (e.g. ```Fix #11```).
please reference the issue in the PR description (e.g. ```Fix #11```).
See [this][closing-via-message] for more details.

* Please use the present tense and imperative mood when describing your changes:
Expand All @@ -196,15 +196,15 @@ Additional references:
* For `.h`, `.cpp`, and `.cs` files use the copyright header with empty line after it:

```c#
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
<Add empty line here>
```

* For `.ps1` and `.psm1` files use the copyright header with empty line after it:

```powershell
# Copyright (c) Microsoft Corporation. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<Add empty line here>
```
Expand All @@ -214,7 +214,7 @@ Additional references:
```powershell
Author = "PowerShell"
Company = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation. All rights reserved."
Copyright = "Copyright (c) Microsoft Corporation."
```

is at the top.
Expand Down Expand Up @@ -277,10 +277,10 @@ Additional references:
- `Request changes` if you believe the PR merge should be blocked if your feedback is not addressed,
- `Approve` if you believe your feedback has been addressed or the code is fine as-is, it is customary (although not required) to leave a simple "Looks good to me" (or "LGTM") as the comment for approval.
- `Comment` if you are making suggestions that the *author* does not have to accept.
Early in the review, it is acceptable to provide feedback on coding formatting based on the published [Coding Guidelines](../docs/dev-process/coding-guidelines.md), however,
after the PR has been approved, it is generally _not_ recommended to focus on formatting issues unless they go against the [Coding Guidelines](../docs/dev-process/coding-guidelines.md).
Early in the review, it is acceptable to provide feedback on coding formatting based on the published [Coding Guidelines][coding-guidelines], however,
after the PR has been approved, it is generally _not_ recommended to focus on formatting issues unless they go against the [Coding Guidelines][coding-guidelines].
Non-critical late feedback (after PR has been approved) can be submitted as a new issue or new pull request from the *reviewer*.
1. *Assignee* who are always *Maintainers* ensure that proper review has occurred and if they believe one approval is not sufficient, the *maintainer* is responsible to add more reviewers.
1. *Assignees* who are always *Maintainers* ensure that proper review has occurred and if they believe one approval is not sufficient, the *maintainer* is responsible to add more reviewers.
An *assignee* may also be a reviewer, but the roles are distinct.
Once the PR has been approved and the CI system is passing, the *assignee* will merge the PR after giving one business day for any critical feedback.
For more information on the PowerShell Maintainers' process, see the [documentation](../docs/maintainers).
Expand All @@ -302,22 +302,22 @@ In these cases:
## Making Breaking Changes

When you make code changes,
please pay attention to these that can affect the [Public Contract](../docs/dev-process/breaking-change-contract.md).
please pay attention to these that can affect the [Public Contract][breaking-changes-contract].
For example, changing PowerShell parameters, APIs, or protocols break the public contract.
Before making changes to the code,
first review the [breaking changes contract](../docs/dev-process/breaking-change-contract.md)
first review the [breaking changes contract][breaking-changes-contract]
and follow the guidelines to keep PowerShell backward compatible.

## Making Design Changes

To add new features such as cmdlets or making design changes,
please follow the [PowerShell Request for Comments (RFC)](https://github.com/PowerShell/PowerShell-RFC) process.
please follow the [PowerShell Request for Comments (RFC)][rfc-process] process.

## Common Engineering Practices

Other than the guidelines for ([coding](../docs/dev-process/coding-guidelines.md),
the [RFC process](https://github.com/PowerShell/PowerShell-RFC) for design,
[documentation](#contributing-to-documentation) and [testing](../docs/testing-guidelines/testing-guidelines.md)) discussed above,
Other than the guidelines for [coding][coding-guidelines],
the [RFC process][rfc-process] for design,
[documentation](#contributing-to-documentation) and [testing](../docs/testing-guidelines/testing-guidelines.md) discussed above,
we encourage contributors to follow these common engineering practices:

* Format commit messages following these guidelines:
Expand Down Expand Up @@ -359,7 +359,7 @@ is also appropriate, as is using Markdown syntax.
If you find code that you think is a good fit to add to PowerShell,
file an issue and start a discussion before proceeding.
* Create and/or update tests when making code changes.
* Run tests and ensure they are passing before pull request.
* Run tests and ensure they are passing before opening a pull request.
* All pull requests **must** pass CI systems before they can be approved.
* Avoid making big pull requests.
Before you invest a large amount of time,
Expand All @@ -368,7 +368,7 @@ is also appropriate, as is using Markdown syntax.
## Contributor License Agreement (CLA)

To speed up the acceptance of any contribution to any PowerShell repositories,
you should to [sign a Microsoft Contribution Licensing Agreement (CLA)](https://cla.microsoft.com/) ahead of time.
you should sign the Microsoft [Contributor License Agreement (CLA)](https://cla.microsoft.com/) ahead of time.
If you've already contributed to PowerShell or Microsoft repositories in the past, congratulations!
You've already completed this step.
This a one-time requirement for the PowerShell project.
Expand All @@ -395,8 +395,10 @@ Once you sign a CLA, all your existing and future pull requests will have the st
[up-for-grabs]: https://github.com/powershell/powershell/issues?q=is%3Aopen+is%3Aissue+label%3AUp-for-Grabs
[semantic linefeeds]: https://rhodesmill.org/brandon/2012/one-sentence-per-line/
[PowerShell-Docs]: https://github.com/powershell/powershell-docs/
[use-vscode-editor]: ../docs/learning-powershell/using-vscode.md#editing-with-visual-studio-code
[use-vscode-editor]: https://docs.microsoft.com/dotnet/core/tutorials/with-visual-studio-code
[repository-maintainer]: ../docs/community/governance.md#repository-maintainers
[area-expert]: ../docs/community/governance.md#area-experts
[ci-system]: ../docs/testing-guidelines/testing-guidelines.md#ci-system
[first-time-issue]: https://github.com/powershell/powershell/issues?q=is%3Aopen+is%3Aissue+label%3AFirst-Time-Issue
[coding-guidelines]: ../docs/dev-process/coding-guidelines.md
[breaking-changes-contract]: ../docs/dev-process/breaking-change-contract.md
[rfc-process]: https://github.com/PowerShell/PowerShell-RFC
Loading

0 comments on commit 90cb59e

Please sign in to comment.