lint things

Summary:
Lint related fixes: Improve internal/OSS consistency. Fix the fight between black and certain pyre-ignore markers by moving them to the line before.
Use clang-format-8 automatically if present. Small number of pyre fixes.

arc doesn't run pyre at the moment, so I put back the explicit call to pyre. I don't know if there's an option somewhere to change this.

Reviewed By: nikhilaravi

Differential Revision: D19780518

fbshipit-source-id: ef1c243392322fa074130f6cff2dd8a6f7738a7f
This commit is contained in:
Jeremy Reizenstein
2020-02-21 05:03:38 -08:00
committed by Facebook Github Bot
parent 9e21659fc5
commit e491efb81f
11 changed files with 66 additions and 52 deletions

View File

@@ -8,7 +8,7 @@ import os
import pathlib
import warnings
from collections import namedtuple
from typing import List
from typing import List, Optional
import torch
from fvcore.common.file_io import PathManager
from PIL import Image
@@ -519,7 +519,7 @@ def load_mtl(f_mtl, material_names: List, data_dir: str):
return material_properties, texture_images
def save_obj(f, verts, faces, decimal_places: int = None):
def save_obj(f, verts, faces, decimal_places: Optional[int] = None):
"""
Save a mesh to an .obj file.
@@ -544,7 +544,7 @@ def save_obj(f, verts, faces, decimal_places: int = None):
# TODO (nikhilar) Speed up this function.
def _save(f, verts, faces, decimal_places: int = None):
def _save(f, verts, faces, decimal_places: Optional[int] = None):
if verts.dim() != 2 or verts.size(1) != 3:
raise ValueError("Argument 'verts' should be of shape (num_verts, 3).")
if faces.dim() != 2 or faces.size(1) != 3: