https://github.com/postsharp/postsharp.engineering.codestyle
.editorconfig and Rider configuration for our projects
https://github.com/postsharp/postsharp.engineering.codestyle
Last synced: 3 days ago
JSON representation
.editorconfig and Rider configuration for our projects
- Host: GitHub
- URL: https://github.com/postsharp/postsharp.engineering.codestyle
- Owner: postsharp
- License: mit
- Created: 2021-12-02T09:01:20.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-01T15:05:50.000Z (over 1 year ago)
- Last Synced: 2025-03-03T15:48:16.891Z (12 months ago)
- Size: 57.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PostSharp Engineering: Code Style Features
Make sure you have read and understood [PostSharp Engineering](../README.md) before reading this doc.
## Table of contents
- [PostSharp Engineering: Code Style Features](#postsharp-engineering-code-style-features)
- [Table of contents](#table-of-contents)
- [Introduction](#introduction)
- [Installation](#installation)
- [Configuration](#configuration)
- [Code style cleanup](#code-style-cleanup)
## Introduction
This repository contains centralized code-style configurations and scripts.
Unified base code-style is found under `Standard` directory.
Other projects using slightly altered code-style configuration are in their own directories, respective to the name of the project.
## Installation
1. Copy the `PostSharp.Engineering.CodeStyle` repo to your own repo into `eng/style` using `PostSharp.Engineering.BuildTools`, with the command:
```
.\Build.ps1 codestyle pull
```
This tool will create a symlink for `.editorconfig`.
2. Enable symlinks for your repo (edit `.git/config`).
3. For each solution, in Rider, open Settings, choose "Manage Layers", select the team-shared layer, click on the `+` icon and then on "Open Settings File", then choose `eng/style/CommonStyle.DotSettings`.
This step is required for code formatting using `Build.ps1 codestyle format`, even if you are otherwise not using Rider.
## Configuration
The code quality configuration is configured in the following files:
- `.editorconfig`
- `CommonStyle.DotSettings` (used by JetBrains tools)
- `stylecop.json`
## Code style cleanup
1. Commit all your changes. You cannot reformat a repo with uncommitted changes.
2. Do `.\Build.ps1 codestyle format` from the repo root (see `PostSharp.Engineering`).