Skip to content
Merged
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
32 changes: 4 additions & 28 deletions docs/input/guidelines/CakeContribIcon.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Title: CakeContrib-Icon
- [Settings](#settings)
- [Icon-Location](#icon-location)
- [Icon include in project](#icon-include-in-project)
- [migrating from an existing project](#migrating-from-an-existing-project)
- [Migrating from an existing project](#migrating-from-an-existing-project)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand All @@ -40,36 +40,12 @@ With no special settings at all (i.e. "The Standard"):
## Settings

### Icon-Location
The default location of the icon is `icon.png`, next to the csproj (i.e. `$(MSBuildProjectDirectory)/icon.png`).

Setting `CakeContribGuidelinesIconDestinationLocation` makes it possible to override the default location of the Icon. For example setting

```xml
<PropertyGroup>
<IconDestinationLocation>../logo.png</IconDestinationLocation>
</PropertyGroup>
```

in the csproj will place the icon as `logo.png` one folder up (relative to the current project).
<?! Include "../settings/fragments/IconDestinationLocation.md" /?>

### Icon include in project
The icon will be automatically included in the project, unless `CakeContribGuidelinesIconOmitImport` was defined.

To to use a "custom" import the following could be used:

```xml
<PropertyGroup>
<CakeContribGuidelinesIconOmitImport>1</CakeContribGuidelinesIconOmitImport>
</PropertyGroup>
<ItemGroup>
<None Include="$(CakeContribGuidelinesIconDestinationLocation)">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
```
<?! Include "../settings/fragments/IconOmitImport.md" /?>

### migrating from an existing project
## Migrating from an existing project

* remove the existing icon
* remove the `Include` of the icon from the project-file
Expand Down
10 changes: 1 addition & 9 deletions docs/input/guidelines/PrivateAssets.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,4 @@ Using this package automatically enables this guideline.

### Opt-Out

It it possible to opt-out of the check for `PrivateAssets` using the following setting:

(*Keep in mind, though that it is not recommended to opt-out of this feature*)

```xml
<PropertyGroup>
<CakeContribGuidelinesCakeReferenceOmitPrivateCheck>1</CakeContribGuidelinesCakeReferenceOmitPrivateCheck>
</PropertyGroup>
```
<?! Include "../settings/fragments/OmitPrivateCheck.md" /?>
21 changes: 3 additions & 18 deletions docs/input/guidelines/RecommendedReferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,6 @@ Using this package automatically enables this guideline.

### Opt-Out

It it possible to opt-out of the check for StyleCop using the following setting:

(*Keep in mind, though that it is not recommended to opt-out of this feature*)

```xml
<ItemGroup>
<CakeContribGuidelinesOmitRecommendedReference Include="StyleCop.Analyzers" />
</ItemGroup>
```

It is also possible to opt-out of the check for configuration-files (`stylecop.json` as well as `.editorconfig`)
using the following settings:
```xml
<ItemGroup>
<CakeContribGuidelinesOmitRecommendedConfigFile Include="stylecop.json" />
<CakeContribGuidelinesOmitRecommendedConfigFile Include=".editorconfig" />
</ItemGroup>
```
<?! Include "../settings/fragments/OmitRecommendedReference.md" /?>

<?! Include "../settings/fragments/OmitRecommendedConfigFile.md" /?>
11 changes: 1 addition & 10 deletions docs/input/guidelines/TargetFramework.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,4 @@ Using this package automatically enables this guideline.

### Opt-Out

It it possible to opt-out of the check for target framework using the following setting:

(*Keep in mind, though that it is not recommended to opt-out of this feature*)

```xml
<ItemGroup>
<CakeContribGuidelinesOmitTargetFramework Include="netstandard2.0" />
<CakeContribGuidelinesOmitTargetFramework Include="net461" />
</ItemGroup>
```
<?! Include "../settings/fragments/OmitTargetFramework.md" /?>
1 change: 0 additions & 1 deletion docs/input/rules/ccg0004.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ should never be exposed to consuming packages.
## How to fix violations

Add the attribute `PrivateAssets="all"` to all required references.
(Or opt-out of this rule, by setting `CakeContribGuidelinesCakeReferenceOmitPrivateCheck`)

## Related guidelines

Expand Down
1 change: 0 additions & 1 deletion docs/input/rules/ccg0005.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Usage of [StyleCop](https://github.com/DotNetAnalyzers/StyleCopAnalyzers) is rec
## How to fix violations

Add a reference to [StyleCop](https://github.com/DotNetAnalyzers/StyleCopAnalyzers).
(Or opt-out of this rule, by setting `CakeContribGuidelinesOmitRecommendedReference`)

## Related guidelines

Expand Down
2 changes: 0 additions & 2 deletions docs/input/rules/ccg0006.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ Example-Files can be found at:
* [`stylecop.json`](../guidelines/examples/StyleCopJson)
* [`.editorconfig`](../guidelines/examples/Editorconfig)

(Or opt-out of this rule, by setting `CakeContribGuidelinesOmitRecommendedConfigFile`)

## Related guidelines

* [Recommended References](../guidelines/RecommendedReferences)
2 changes: 0 additions & 2 deletions docs/input/rules/ccg0007.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ Add the recommended target(s) to the project (example for an addin referencing C
</PropertyGroup>
```

(Or opt-out of this rule, by setting `CakeContribGuidelinesOmitTargetFramework`)

## Related guidelines

* [Target Frameworks](../guidelines/TargetFramework)
18 changes: 18 additions & 0 deletions docs/input/settings/fragments/IconDestinationLocation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->



<!-- END doctoc generated TOC please keep comment here to allow auto update -->

The default location of the cake-contrib icon is `icon.png`, next to the csproj (i.e. `$(MSBuildProjectDirectory)/icon.png`).

Setting `CakeContribGuidelinesIconDestinationLocation` makes it possible to override the default location of the Icon. For example setting

```xml
<PropertyGroup>
<CakeContribGuidelinesIconDestinationLocation>../logo.png</CakeContribGuidelinesIconDestinationLocation>
</PropertyGroup>
```

in the csproj will place the icon as `logo.png` one folder up (relative to the current project).
22 changes: 22 additions & 0 deletions docs/input/settings/fragments/IconOmitImport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->



<!-- END doctoc generated TOC please keep comment here to allow auto update -->

The cake-contrib icon will be automatically included in the project, unless `CakeContribGuidelinesIconOmitImport` was defined.

To to use a "custom" import the following could be used:

```xml
<PropertyGroup>
<CakeContribGuidelinesIconOmitImport>1</CakeContribGuidelinesIconOmitImport>
</PropertyGroup>
<ItemGroup>
<None Include="$(CakeContribGuidelinesIconDestinationLocation)">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
```
16 changes: 16 additions & 0 deletions docs/input/settings/fragments/OmitPrivateCheck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->



<!-- END doctoc generated TOC please keep comment here to allow auto update -->

It it possible to opt-out of the check for `PrivateAssets` using the `CakeContribGuidelinesCakeReferenceOmitPrivateCheck` setting:

(*Keep in mind, though that it is not recommended to opt-out of this feature*)

```xml
<PropertyGroup>
<CakeContribGuidelinesCakeReferenceOmitPrivateCheck>1</CakeContribGuidelinesCakeReferenceOmitPrivateCheck>
</PropertyGroup>
```
16 changes: 16 additions & 0 deletions docs/input/settings/fragments/OmitRecommendedConfigFile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->



<!-- END doctoc generated TOC please keep comment here to allow auto update -->

It is possible to opt-out of the check for configuration-files by using the `CakeContribGuidelinesOmitRecommendedConfigFile` setting
and setting it's `Include` to the file name that should not be checked:

```xml
<ItemGroup>
<CakeContribGuidelinesOmitRecommendedConfigFile Include="stylecop.json" />
<CakeContribGuidelinesOmitRecommendedConfigFile Include=".editorconfig" />
</ItemGroup>
```
17 changes: 17 additions & 0 deletions docs/input/settings/fragments/OmitRecommendedReference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->



<!-- END doctoc generated TOC please keep comment here to allow auto update -->

It it possible to opt-out of the check for recommended references by using the `CakeContribGuidelinesOmitRecommendedReference` setting
and setting it's `Include` to the reference that should not be checked.

(*Keep in mind, though that it is not recommended to opt-out of this feature*)

```xml
<ItemGroup>
<CakeContribGuidelinesOmitRecommendedReference Include="StyleCop.Analyzers" />
</ItemGroup>
```
19 changes: 19 additions & 0 deletions docs/input/settings/fragments/OmitTargetFramework.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->



<!-- END doctoc generated TOC please keep comment here to allow auto update -->

It it possible to opt-out of the check for target framework(s) by using the `CakeContribGuidelinesOmitTargetFramework` setting
and setting it's `Include` to the target framework that should not be checked.

(*Keep in mind, though that it is not recommended to opt-out of this feature*)

```xml
<ItemGroup>
<CakeContribGuidelinesOmitTargetFramework Include="netstandard2.0" />
<CakeContribGuidelinesOmitTargetFramework Include="net461" />
</ItemGroup>
```

62 changes: 62 additions & 0 deletions docs/input/settings/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
Title: Settings
Order: 3
NoSidebar: true
---

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents

- [General](#general)
- [ProjectType](#projecttype)
- [Icons](#icons)
- [IconDestinationLocation](#icondestinationlocation)
- [IconOmitImport](#iconomitimport)
- [Opt-Out](#opt-out)
- [OmitRecommendedConfigFile](#omitrecommendedconfigfile)
- [OmitRecommendedReference](#omitrecommendedreference)
- [OmitPrivateCheck](#omitprivatecheck)
- [OmitTargetFramework](#omittargetframework)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## General

### ProjectType
A project can be one of two types: `addin` or `module`. Some rules have different behavior for
different project types.
The project type is automatically detected. To override auto-detection use the following:

```xml
<PropertyGroup>
<CakeContribGuidelinesProjectType>module</CakeContribGuidelinesProjectType>
</PropertyGroup>
```

:::{.alert .alert-info}
Though you can technically set `CakeContribGuidelinesProjectType` to anything you want, setting it to
different values than `addin` or `module` might yield unexpected results.
:::

## Icons

### IconDestinationLocation
<?! Include "./fragments/IconDestinationLocation.md" /?>

### IconOmitImport
<?! Include "./fragments/IconOmitImport.md" /?>

## Opt-Out

### OmitRecommendedConfigFile
<?! Include "./fragments/OmitRecommendedConfigFile.md" /?>

### OmitRecommendedReference
<?! Include "./fragments/OmitRecommendedReference.md" /?>

### OmitPrivateCheck
<?! Include "./fragments/OmitPrivateCheck.md" /?>

### OmitTargetFramework
<?! Include "./fragments/OmitTargetFramework.md" /?>
3 changes: 2 additions & 1 deletion src/CakeContrib.Guidelines.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Addin/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
25 changes: 25 additions & 0 deletions src/Guidelines/build/CakeContrib.Guidelines.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,29 @@
<Import Project="$(MSBuildThisFileDirectory)RequiredReferences.targets" />
<Import Project="$(MSBuildThisFileDirectory)RequiredFiles.targets" />
<Import Project="$(MSBuildThisFileDirectory)TargetFrameworkVersions.targets" />

<UsingTask
TaskName="$(CakeContribGuidelinesCustomTasksNamespace).CalculateProjectType"
AssemblyFile="$(CakeContribGuidelinesCustomTasksAssembly)" />

<Target
Name="EnsureProjectTypeIsSet">
<ItemGroup>
<ProjectNames Include="$(AssemblyName)" />
<ProjectNames Include="$(PackageId)" />
</ItemGroup>

<CalculateProjectType
ProjectType="$(CakeContribGuidelinesProjectType)"
ProjectNames="@(ProjectNames)">
<Output PropertyName="TempCakeContribGuidelinesProjectType" TaskParameter="Output"/>
</CalculateProjectType>
<CreateProperty
Value="$(TempCakeContribGuidelinesProjectType)">
<Output
TaskParameter="Value"
PropertyName="CakeContribGuidelinesProjectType" />
</CreateProperty>
</Target>

</Project>
Loading