mirror of
				https://github.com/astral-sh/ruff.git
				synced 2025-10-30 11:36:57 +00:00 
			
		
		
		
	[refurb] Make example error out-of-the-box (FURB157) (#19695)
				
					
				
			## Summary Part of #18972 This PR makes [verbose-decimal-constructor (FURB157)](https://docs.astral.sh/ruff/rules/verbose-decimal-constructor/#verbose-decimal-constructor-furb157)'s example error out-of-the-box. [Old example](https://play.ruff.rs/0930015c-ad45-4490-800e-66ed057bfe34) ```py Decimal("0") Decimal(float("Infinity")) ``` [New example](https://play.ruff.rs/516e5992-322f-4203-afe7-46d8cad53368) ```py from decimal import Decimal Decimal("0") Decimal(float("Infinity")) ``` Imports were also added to the "Use Instead" section.
This commit is contained in:
		
							parent
							
								
									dce25da19a
								
							
						
					
					
						commit
						580577e667
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -30,12 +30,16 @@ use crate::{Edit, Fix, FixAvailability, Violation}; | ||||||
| ///
 | ///
 | ||||||
| /// ## Example
 | /// ## Example
 | ||||||
| /// ```python
 | /// ```python
 | ||||||
|  | /// from decimal import Decimal
 | ||||||
|  | ///
 | ||||||
| /// Decimal("0")
 | /// Decimal("0")
 | ||||||
| /// Decimal(float("Infinity"))
 | /// Decimal(float("Infinity"))
 | ||||||
| /// ```
 | /// ```
 | ||||||
| ///
 | ///
 | ||||||
| /// Use instead:
 | /// Use instead:
 | ||||||
| /// ```python
 | /// ```python
 | ||||||
|  | /// from decimal import Decimal
 | ||||||
|  | ///
 | ||||||
| /// Decimal(0)
 | /// Decimal(0)
 | ||||||
| /// Decimal("Infinity")
 | /// Decimal("Infinity")
 | ||||||
| /// ```
 | /// ```
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 GiGaGon
						GiGaGon