Skip to content

fix: MD031/blanks-around-fences #3077

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"MD027": false,
"MD028": false,
"MD029": false,
"MD031": false,
"MD032": false,
"MD033": {
"allowed_elements": [
Expand Down
5 changes: 5 additions & 0 deletions docs/ai/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Deep learning frameworks rely on pip for their own installation.
Then, we need to verify whether Python 3.5 is installed correctly, and upgrade pip to the latest version by executing the following commands in a terminal:

- **Windows**

```cmd
C:\Users\test>python -V
Python 3.5.4
Expand All @@ -92,6 +93,7 @@ Then, we need to verify whether Python 3.5 is installed correctly, and upgrade p
```

- **macOS**

```bash
MyMac:~ test$ python3.5 -V
Python 3.5.4
Expand Down Expand Up @@ -153,10 +155,13 @@ Visit [here](https://caffe2.ai/docs/getting-started.html) to build from source c
To install MXNet, run the following command in a terminal:

- With GPU

```bash
pip3.5 install mxnet-cu80==0.12.0
```

- Without GPU

```bash
pip3.5 install mxnet==0.12.0
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ If you're using Azure SDK 2.5 and want to specify a custom data source, you can
<DataSource name="CustomDataSource!*" />
</WindowsEventLog>
```

### Performance counters
Performance counter information can help you locate system bottlenecks and fine-tune system and application performance. For more information, see [Create and use performance counters in an Azure application](https://msdn.microsoft.com/library/azure/hh411542.aspx). To capture performance counters, select the **Enable transfer of Performance Counters** check box. To increase or decrease the interval between the transfer of event logs to your storage account, change the **Transfer Period (min)** value. Select the check boxes for the performance counters that you want to track.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ while (true)
}
}
```

## Consider using asynchronous Service Bus methods
### ID
AP2003
Expand Down
1 change: 1 addition & 0 deletions docs/azure/vs-azure-tools-resource-groups-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ The following procedures walk you through the steps necessary to configure conti
```
-_artifactsLocation $(artifactsLocation) -_artifactsLocationSasToken (ConvertTo-SecureString -String "$(artifactsLocationSasToken)" -AsPlainText -Force)
```

![Configure Azure Resource Group Deployment Task](media/vs-azure-tools-resource-groups-ci-in-vsts/walkthrough18.png)
7. After you’ve added all the required items, save the build pipeline and choose **Queue new build** at the top.

Expand Down
2 changes: 2 additions & 0 deletions docs/code-quality/C26404.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Once owner pointer releases or transfers its resource, it gets into an "invalid"
Deleting such a pointer may lead to immediate memory corruption due to double delete, or to an access violation when the deleted resource is accessed from another owner pointer.

## Example 1: Deleting an owner after transferring its value

```cpp
gsl::owner<State*> validState = nullptr;
gsl::owner<State*> state = ReadState();
Expand All @@ -27,6 +28,7 @@ if (!IsValid(state))
```

## Example 2: Deleting an uninitialized owner

```cpp
gsl::owner<Message*> message;
if (popLast)
Expand Down
1 change: 1 addition & 0 deletions docs/code-quality/C26405.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ms.workload:
If an owner pointer already points to a valid memory buffer, it must not be assigned to another value without releasing its current resource first. Such assignment may lead to a resource leak even if the resource address is copied into some raw pointer (because raw pointers shouldn’t release resources).

## Example 1: Overwriting an owner in a loop

```cpp
gsl::owner<Shape*> shape = nullptr;
while (shape = NextShape()) // C26405
Expand Down
1 change: 1 addition & 0 deletions docs/code-quality/C26406.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ms.workload:
Owners are initialized from allocations or from other owners. Assigning a value from a raw pointer to an owner pointer is not allowed. Raw pointers don’t guarantee ownership transfer; there is still may be an original owner which holds the resource and will attempt to release it. Note that assigning a value from owner to a raw pointer is fine; raw pointers are valid clients to access resources, but not to manage them.

## Example 1: Using address of object

```cpp
gsl::owner<Socket*> socket = defaultSocket ? &defaultSocket : new Socket(); // C26406
```
5 changes: 5 additions & 0 deletions docs/code-quality/C26407.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,31 @@ To avoid unnecessary use of pointers we try to detect common patterns of local a
- The pattern is detected only for local variables, so we don’t warn on cases where an allocation is assigned to, say, a global variable and then deleted in the same function.

## Example 1: Unnecessary object allocation on heap

```cpp
auto tracer = new Tracer();
ScanObjects(tracer);
delete tracer; // C26407
```

## Example 2: Unnecessary object allocation on heap (fixed with local object)

```cpp
Tracer tracer; // OK
ScanObjects(&tracer);
```

## Example 3: Unnecessary buffer allocation on heap

```cpp
auto value = new char[maxValueSize];
if (ReadSetting(name, value, maxValueSize))
CheckValue(value);
delete[] value; // C26407
```

## Example 4: Unnecessary buffer allocation on the heap (fixed with container)

```cpp
auto value = std::vector<char>(maxValueSize); // OK
if (ReadSetting(name, value.data(), maxValueSize))
Expand Down
1 change: 1 addition & 0 deletions docs/code-quality/C26410.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Generally, references to const unique pointer are meaningless. They can safely b
- Template code may produce a lot of noise. Keep in mind that templates can be instantiated with various type parameters with different levels of indirection, including references. Some warnings may not be obvious and fixes may require some rework of templates (for example, explicit removal of reference indirection). If template code is intentionally generic, the warning can be suppressed.

## Example 1: Unnecessary reference

```cpp
std::vector<std::unique_ptr<Tree>> roots = GetRoots();
std::for_each(
Expand Down
4 changes: 4 additions & 0 deletions docs/code-quality/C26450.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ int multiply()
return c;
}
```

To correct this warning, use the following code.

```cpp
Expand All @@ -53,6 +54,7 @@ int add()
return c;
}
```

To correct this warning, use the following code:

```cpp
Expand All @@ -64,6 +66,7 @@ long long add()
return c;
}
```

## Example 3

```cpp
Expand All @@ -75,6 +78,7 @@ int subtract()
return c;
}
```

To correct this warning, use the following code.

```cpp
Expand Down
2 changes: 2 additions & 0 deletions docs/code-quality/C26451.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void leftshift(int i)
// code
}
```

To correct this warning, use the following code:

```cpp
Expand All @@ -41,6 +42,7 @@ void leftshift(int i)
// code
}
```

## Example 2

```cpp
Expand Down
1 change: 1 addition & 0 deletions docs/code-quality/C26452.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ unsigned __int64 combine(unsigned lo, unsigned hi)
return (hi << 32) | lo; // C26252 here
}
```

To correct this warning, use the following code:

```cpp
Expand Down
1 change: 1 addition & 0 deletions docs/code-quality/C26454.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ unsigned int negativeunsigned()
return x;
}
```

To correct this warning, use the following code:

```cpp
Expand Down
1 change: 1 addition & 0 deletions docs/code-quality/c28112.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ inter_var --;
...
InterlockedIncrement(&inter_var);
```

The following code example avoids this warning:

```cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ End Class
```

### Solution

```csharp
using System;
using System.IO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ End Class
```

### Solution

```csharp
using System;
using System.IO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ By default, after you separate the dataset and TableAdapter code, the result is
' to the CustomersDataTable.
End Class
```

```csharp
partial class CustomersDataTable
{
Expand Down
2 changes: 2 additions & 0 deletions docs/data-tools/add-validation-to-an-n-tier-dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ End Sub
End If
End If
```

```csharp
// Add this code to the DataTable partial class.

Expand Down Expand Up @@ -130,6 +131,7 @@ End Sub
End Sub
End Class
```

```csharp
partial class OrdersDataTable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ To complete the NewCustomer form logic, follow these steps.
```csharp
using System.Data.SqlClient;
```

```vb
Imports System.Data.SqlClient
```
Expand Down Expand Up @@ -206,6 +207,7 @@ To complete the FillOrCancel form logic, follow these steps.
using System.Data.SqlClient;
using System.Text.RegularExpressions;
```

```vb
Imports System.Data.SqlClient
Imports System.Text.RegularExpressions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ To set up your computer so that you can run the [!INCLUDE[vstecasp](../code-qual
```cmd
iisreset
```

— or —

```cmd
Expand Down
1 change: 1 addition & 0 deletions docs/debugger/using-breakpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ To visually trace breakpoints during code execution, see [Map methods on the cal
```C++
((my_class *) 0xcccccccc)->my_method
```

::: moniker range=">= vs-2019"

## <a name="BKMK_set_a_data_breakpoint_managed"></a>Set data breakpoints (.NET Core 3.0 or higher)
Expand Down
1 change: 1 addition & 0 deletions docs/debugger/using-the-debuggerdisplay-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public sealed class MyClass
}
}
```

The ",nq" suffix tells the expression evaluator to remove the quotes when displaying the final value (nq = no quotes).

## Example
Expand Down
1 change: 1 addition & 0 deletions docs/debugger/walkthrough-debugging-at-design-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ In some declarative data binding scenarios, it can help to debug code behind in
```xaml
<TextBlock Text="{Binding title, ConverterParameter=lower, Converter={StaticResource StringFormatConverter}, Mode=TwoWay}" />
```

When the page loads, the breakpoint is hit.

## See also
Expand Down
1 change: 1 addition & 0 deletions docs/deployment/tutorial-import-publish-settings-azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ A publish settings file (*\*.publishsettings*) is different than a publishing pr
</publishProfile>
</publishData>
```

Typically, the preceding *.publishsettings file contains two publishing profiles that you can use in Visual Studio, one to deploy using Web Deploy, and one to deploy using FTP. The preceding code shows the Web Deploy profile. Both profiles will be imported later when you import the profile.

## Import the publish settings in Visual Studio and deploy
Expand Down
2 changes: 2 additions & 0 deletions docs/extensibility/adding-an-lsp-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ Follow these steps below to add support for settings to your LSP language servic
"foo.maxNumberOfProblems": -1
}
```

2. Right-click on the JSON file and select **Properties**. Change the **Build** action to "Content" and the "Include in VSIX' property to true.

3. Implement ConfigurationSections and return the list of prefixes for the settings defined in the JSON file (In Visual Studio Code, this would map to the configuration section name in package.json):
Expand All @@ -313,6 +314,7 @@ Follow these steps below to add support for settings to your LSP language servic
```

Sample:

```
[$RootKey$\OpenFolder\Settings\VSWorkspaceSettings\MockLanguageExtension]
@="$PackageFolder$\MockLanguageExtensionSettings.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ This structure is part of the union in the [DEBUG_ADDRESS_UNION](../../../extens
> ```cpp
> if (addr.dwKind == ADDRESS_KIND_METADATA_LOCAL && addr.addr.addrLocal.pLocal != NULL)
> {
addr.addr.addrLocal.pLocal->Release();
> addr.addr.addrLocal.pLocal->Release();
> }
> ```

Expand Down
8 changes: 8 additions & 0 deletions docs/extensibility/image-service-and-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ CGlobalServiceProvider::HrQueryService(SID_SVsImageService, &spImgSvc);
**Requesting the image**

::: moniker range="vs-2017"

```cpp
ImageAttributes attr = { 0 };
attr.StructSize = sizeof(attributes);
Expand All @@ -361,9 +362,11 @@ CComPtr<IVsUIObject> spImg;
// Replace this KnownMoniker with your desired ImageMoniker
spImgSvc->GetImage(KnownMonikers::Blank, attributes, &spImg);
```

::: moniker-end

::: moniker range=">=vs-2019"

```cpp
UINT dpiX, dpiY;
HWND hwnd = // get the HWND where the image will be displayed
Expand All @@ -385,6 +388,7 @@ CComPtr<IVsUIObject> spImg;
// Replace this KnownMoniker with your desired ImageMoniker
spImgSvc->GetImage(KnownMonikers::Blank, attributes, &spImg);
```

::: moniker-end

## How do I update WinForms UI?
Expand All @@ -407,6 +411,7 @@ IVsImageService2 imageService = (IVsImageService2)Package.GetGlobalService(typeo
**Request the image**

::: moniker range="vs-2017"

```csharp
ImageAttributes attributes = new ImageAttributes
{
Expand All @@ -428,9 +433,11 @@ IVsUIObject uIObj = imageService.GetImage(KnownMonikers.Blank, attributes);
Bitmap bitmap = (Bitmap)GelUtilities.GetObjectData(uiObj); // Use this if you need a bitmap
// Icon icon = (Icon)GelUtilities.GetObjectData(uiObj); // Use this if you need an icon
```

::: moniker-end

::: moniker range=">=vs-2019"

```csharp
Control control = // get the control where the image will be displayed

Expand All @@ -454,6 +461,7 @@ IVsUIObject uIObj = imageService.GetImage(KnownMonikers.Blank, attributes);
Bitmap bitmap = (Bitmap)GelUtilities.GetObjectData(uiObj); // Use this if you need a bitmap
// Icon icon = (Icon)GelUtilities.GetObjectData(uiObj); // Use this if you need an icon
```

::: moniker-end

## How do I use image monikers in a new tool window?
Expand Down
Loading