- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.2k
          [format check] Misleading scientific, engineering, or underscore grouping notations in float
          #10425
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
  
    [format check] Misleading scientific, engineering, or underscore grouping notations in float
  
  #10425
              Conversation
| if string.endswith("l"): | ||
| self.add_message("lowercase-l-suffix", line=line_num) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never raised anywhere, the definition of the message cannot be found, not sure what it's about.
| Codecov Report❌ Patch coverage is  
 ❌ Your patch check has failed because the patch coverage (97.35%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@            Coverage Diff             @@
##             main   #10425      +/-   ##
==========================================
+ Coverage   95.96%   95.98%   +0.01%     
==========================================
  Files         176      176              
  Lines       19525    19710     +185     
==========================================
+ Hits        18738    18919     +181     
- Misses        787      791       +4     
 🚀 New features to boost your workflow:
 | 
fdf5bc1    to
    18b00a7      
    Compare
  
    float
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems useful, but would probably make it an extension? Or perhaps, first have it as an extension to get feedback?
| +1 for the idea | 
floatfloat
      floatfloat
      f3ff9d4    to
    1db9508      
    Compare
  
            
          
                pylint/checkers/format.py
              
                Outdated
          
        
      | "x" not in string # not a hexadecimal | ||
| and "o" not in string # not an octal | ||
| and "j" not in string # not a complex | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP 515 is talking about separating word in hexadecimal, might want to do something about it... later.
1db9508    to
    77a3d6b      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
cbe8b6a    to
    2886dc7      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
8ba51e0    to
    35898de      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
afc04e3    to
    dc7592d      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
dc7592d    to
    bad3e82      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
bad3e82    to
    29d7772      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
Co-authored-by: shauss <[email protected]>
…arily for easier primer reading)
29d7772    to
    bb5037e      
    Compare
  
    | 🤖 Effect of this PR on checked open source code: 🤖 Effect on home-assistant: 
 Effect on music21: 
 The following messages are no longer emitted: 
 Effect on django: 
 Effect on sentry: 
 This comment was generated for commit bb5037e | 
Type of Changes
Description
A little experiment to gather feedback with primers and reviews (still a draft).
The idea is to enforce normalized ways to write number above a threshold or close to 0 in absolute value:
Another idea could be to warn to use python's Decimal for number with more than 15 digits of precision, not sure if it should be the same checker though. We could also set/enforce a default precision for a project.