mirror of
				https://github.com/facebookresearch/pytorch3d.git
				synced 2025-11-04 18:02:14 +08:00 
			
		
		
		
	Enable black + isort fbsource linter
Summary: Enable `black` + `isort` (via `pyfmt`) i.e. `BLACK` fbsource linter. NOTE: the `BLACK` fbsource linter (and `black` itself) is (by design) ***not*** configurable. This forces aligning the existing options used by the tools invoked in `dev/linter.sh` (for 3rd party developers) with `BLACK` fbsource linting. Without this reconciliation, the different linters (used internally or by 3rd party developers) would simply conflict with each other resulting in artificial back-and-forth changes (for instance line width which `BLACK` forces to 88 characters). Reviewed By: nikhilaravi Differential Revision: D20558374 fbshipit-source-id: 614fa00664f8eb9d2de7438c29b807dfbf36ad20
This commit is contained in:
		
							parent
							
								
									37c5c8e0b6
								
							
						
					
					
						commit
						eb512ffde3
					
				
							
								
								
									
										2
									
								
								.flake8
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								.flake8
									
									
									
									
									
								
							@ -1,6 +1,6 @@
 | 
			
		||||
[flake8]
 | 
			
		||||
ignore = E203, E266, E501, W503, E221
 | 
			
		||||
max-line-length = 80
 | 
			
		||||
max-line-length = 88
 | 
			
		||||
max-complexity = 18
 | 
			
		||||
select = B,C,E,F,W,T4,B9
 | 
			
		||||
exclude = build,__init__.py
 | 
			
		||||
 | 
			
		||||
@ -19,7 +19,7 @@ echo "Running isort..."
 | 
			
		||||
isort -y -sp "${DIR}"
 | 
			
		||||
 | 
			
		||||
echo "Running black..."
 | 
			
		||||
black -l 80 "${DIR}"
 | 
			
		||||
black "${DIR}"
 | 
			
		||||
 | 
			
		||||
echo "Running flake..."
 | 
			
		||||
flake8 "${DIR}"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										17
									
								
								setup.cfg
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								setup.cfg
									
									
									
									
									
								
							@ -1,13 +1,10 @@
 | 
			
		||||
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
 | 
			
		||||
 | 
			
		||||
[isort]
 | 
			
		||||
line_length=80
 | 
			
		||||
include_trailing_comma=True
 | 
			
		||||
multi_line_output=3
 | 
			
		||||
known_standard_library=numpy,setuptools
 | 
			
		||||
known_myself=pytorch3d
 | 
			
		||||
known_third_party=fvcore,torch,torchvision,matplotlib,mpl_toolkits,PIL,yaml
 | 
			
		||||
                  jinja2,requests,nbformat,nbconvert,bs4
 | 
			
		||||
no_lines_before=STDLIB,THIRDPARTY
 | 
			
		||||
sections=FUTURE,STDLIB,THIRDPARTY,myself,FIRSTPARTY,LOCALFOLDER
 | 
			
		||||
default_section=FIRSTPARTY
 | 
			
		||||
line_length = 88
 | 
			
		||||
multi_line_output = 3
 | 
			
		||||
include_trailing_comma = True
 | 
			
		||||
force_grid_warp = 0
 | 
			
		||||
default_section = THIRDPARTY
 | 
			
		||||
lines_after_imports = 2
 | 
			
		||||
combine_as_imports = True
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user