mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 10:35:27 +08:00 
			
		
		
		
	Adds documentation for analyzers
This commit is contained in:
		
				
					committed by
					
						
						Patrik Svensson
					
				
			
			
				
	
			
			
			
						parent
						
							a186fd94ac
						
					
				
				
					commit
					fa553fd72e
				
			
							
								
								
									
										27
									
								
								docs/input/analyzer/rules/spectre1000.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								docs/input/analyzer/rules/spectre1000.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
---
 | 
			
		||||
Title: Spectre1000
 | 
			
		||||
Description: Use AnsiConsole instead of System.Console
 | 
			
		||||
Category: Usage
 | 
			
		||||
Severity: Warning
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## Cause
 | 
			
		||||
 | 
			
		||||
A violation of this rule occurs when `System.Console` is used for common methods exposed by Spectre.Console.
 | 
			
		||||
 | 
			
		||||
## Reason for rule
 | 
			
		||||
 | 
			
		||||
Methods implemented in Spectre.Console should be used over direct access to `System.Console` to allow for enhancements and
 | 
			
		||||
features to be enabled.
 | 
			
		||||
 | 
			
		||||
## How to fix violations
 | 
			
		||||
 | 
			
		||||
To fix a violation of this rule, change from `System.Console` to `Spectre.Console.AnsiConsole`.
 | 
			
		||||
 | 
			
		||||
## How to suppress violations
 | 
			
		||||
 | 
			
		||||
```csharp
 | 
			
		||||
#pragma warning disable Spectre1000 // Use AnsiConsole instead of System.Console
 | 
			
		||||
 | 
			
		||||
#pragma warning restore Spectre1000 // Use AnsiConsole instead of System.Console
 | 
			
		||||
```
 | 
			
		||||
		Reference in New Issue
	
	Block a user