rjmurillo/moq.analyzers

View on GitHub

Showing 487 of 513 total issues

Line length
Open

var mock = new Mock<IMyService>("123"); // Moq1001: Mocked interfaces cannot have constructor parameters
Severity: Info
Found in docs/rules/Moq1001.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

Mocks use the `MockBehavior.Loose` by default. Some people find this default behavior undesirable, as it can lead to
Severity: Info
Found in docs/rules/Moq1400.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Multiple headers with the same content
Open

### New Rules

MD024 - Multiple headers with the same content

Tags: headers

Aliases: no-duplicate-header

Parameters: allowdifferentnesting (boolean; default false)

This rule is triggered if there are multiple headers in the document that have the same text:

# Some text

## Some text

To fix this, ensure that the content of each header is different:

# Some text

## Some more text

Rationale: Some markdown parses generate anchors for headers based on the header name, and having headers with the same content can cause problems with this.

If the parameter allow_different_nesting is set to true, header duplication under different nesting is allowed, like it usually happens in change logs:

# Change log

## 2.0.0

### Bug fixes

### Features

## 1.0.0

### Bug fixes

First header should be a top level header
Open

### New Rules

MD002 - First header should be a top level header

Tags: headers

Aliases: first-header-h1

Parameters: level (number; default 1)

This rule is triggered when the first header in the document isn't a h1 header:

## This isn't a H1 header

### Another header

The first header in the document should be a h1 header:

# Start with a H1 header

## Then use a H2 for subsections

Bare URL used
Open

; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md

MD034 - Bare URL used

Tags: links, url

Aliases: no-bare-urls

This rule is triggered whenever a URL is given that isn't surrounded by angle brackets:

For more information, see http://www.example.com/.

To fix this, add angle brackets around the URL:

For more information, see <http:></http:>.

Rationale: Without angle brackets, the URL isn't converted into a link in many markdown parsers.

Note: if you do want a bare URL without it being converted into a link, enclose it in a code block, otherwise in some markdown parsers it will be converted:

`http://www.example.com`

File should end with a single newline character
Open

Moq1400 | Moq      | Warning  | SetExplicitMockBehaviorAnalyzer, [Documentation](https://github.com/rjmurillo/moq.analyzers/blob/main/docs/rules/Moq1400.md)

Line length
Open

The `.As()` method is used when a mocked object must implement multiple interfaces. It cannot be used with abstract or
Severity: Info
Found in docs/rules/Moq1300.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

    .Setup(x => x.Property); // Moq1200: Setup should be used only for overridable members
Severity: Info
Found in docs/rules/Moq1200.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

The signature of the `.Callback()` method must match the signature of the `.Setup()` method. To fix:
Severity: Info
Found in docs/rules/Moq1100.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

Moq.Analyzers follows existing conventions for enabling, disabling, or suppressing rules. See
Severity: Info
Found in README.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

| [Moq1001](./Moq1001.md) | Mocked interfaces cannot have constructor parameters                                    |
Severity: Info
Found in docs/rules/README.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

| [Moq1300](./Moq1300.md) | `Mock.As()` should take interfaces only                                                 |
Severity: Info
Found in docs/rules/README.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

Mocking requires generating a subclass of the class to be mocked. Methods not marked `virtual` cannot be overridden.
Severity: Info
Found in docs/rules/Moq1200.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

Mocking requires generating a subclass of the class to be mocked. Sealed classes cannot be subclassed. To fix:
Severity: Info
Found in docs/rules/Moq1000.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

    .Callback((string s1, int i1) => { }); // Moq1100: Callback signature must match the signature of the mocked method
Severity: Info
Found in docs/rules/Moq1100.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

var mock = new Mock<MyClass>(3); // Moq1002: Parameters provided into mock do not match any existing constructors
Severity: Info
Found in docs/rules/Moq1002.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

    .Setup(c => c.GetAsync().Result); // Moq1201: Setup of async methods should use .ReturnsAsync instance instead of .Result
Severity: Info
Found in docs/rules/Moq1201.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

| [Moq1400](./Moq1400.md) | Explicitly choose a mocking behavior instead of relying on the default (Loose) behavior |
Severity: Info
Found in docs/rules/README.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

var mock = new Mock<IMyService>("123"); // Moq1001: Mocked interfaces cannot have constructor parameters
Severity: Info
Found in docs/rules/Moq1001.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Line length
Open

`$(PedanticMode)` turns on the CI configuration (e.g. `TreatWarningsAsErrors`) and `$(SquiggleCop_AutoBaseline)`
Severity: Info
Found in CONTRIBUTING.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length

Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Severity
Category
Status
Source
Language