diff --git a/.pylintrc b/.pylintrc index d28a5b6d8..ca004ebbb 100644 --- a/.pylintrc +++ b/.pylintrc @@ -340,7 +340,7 @@ indent-after-paren=4 indent-string=' ' # Maximum number of characters on a single line. -max-line-length=100 +max-line-length=120 # Maximum number of lines in a module. max-module-lines=1000 diff --git a/src/kili/adapters/kili_api_gateway/event/queries.py b/src/kili/adapters/kili_api_gateway/event/queries.py index 0f21997c7..c863c078b 100644 --- a/src/kili/adapters/kili_api_gateway/event/queries.py +++ b/src/kili/adapters/kili_api_gateway/event/queries.py @@ -16,7 +16,6 @@ def __init__(self, graphql_client: GraphQLClient) -> None: """Initialize the paginator.""" self._graphql_client = graphql_client - # pylint: disable=too-many-arguments def execute_query_from_paginated_call( self, query: str, diff --git a/src/kili/adapters/kili_api_gateway/user/mappers.py b/src/kili/adapters/kili_api_gateway/user/mappers.py index 91f670473..c5444f87f 100644 --- a/src/kili/adapters/kili_api_gateway/user/mappers.py +++ b/src/kili/adapters/kili_api_gateway/user/mappers.py @@ -35,7 +35,7 @@ def update_user_data_mapper(data: UserDataKiliGatewayInput) -> Dict: return { "activated": data.activated, "apiKey": data.api_key, - # "auth0Id": data.auth0_id, # refused by the backend: only used for service account # noqa: ERA001 # pylint: disable=line-too-long + # "auth0Id": data.auth0_id, # refused by the backend: only used for service account # noqa: ERA001 "email": data.email, "firstname": data.firstname, "hasCompletedLabelingTour": data.has_completed_labeling_tour, diff --git a/src/kili/adapters/kili_api_gateway/user/types.py b/src/kili/adapters/kili_api_gateway/user/types.py index 44f5fec26..03f62c289 100644 --- a/src/kili/adapters/kili_api_gateway/user/types.py +++ b/src/kili/adapters/kili_api_gateway/user/types.py @@ -25,7 +25,7 @@ class UserDataKiliGatewayInput: activated: Optional[bool] = None api_key: Optional[str] = None - # auth0_id: Optional[str] = None # refused by the backend: only used for service account # noqa: ERA001 # pylint: disable=line-too-long + # auth0_id: Optional[str] = None # refused by the backend: only used for service account # noqa: ERA001 email: Optional[str] = None firstname: Optional[str] = None has_completed_labeling_tour: Optional[bool] = None diff --git a/src/kili/core/graphql/queries.py b/src/kili/core/graphql/queries.py index e42665aec..a2c3860fe 100644 --- a/src/kili/core/graphql/queries.py +++ b/src/kili/core/graphql/queries.py @@ -68,7 +68,6 @@ def __call__( options: QueryOptions, post_call_function: Optional[Callable] = None, ) -> Generator[Dict, None, None]: - # pylint: disable=line-too-long """Get a generator of objects of the specified type in accordance with the provided where.""" fragment = fragment_builder(fields) query = self.query(fragment) diff --git a/src/kili/core/helpers.py b/src/kili/core/helpers.py index 026a4e1e0..7c0aaf7f9 100644 --- a/src/kili/core/helpers.py +++ b/src/kili/core/helpers.py @@ -39,10 +39,8 @@ def format_result( if isinstance(formatted_json, list): if get_origin(object_) is list: obj = get_args(object_)[0] - # pylint: disable=line-too-long return [obj(element) for element in formatted_json] # pyright: ignore[reportGeneralTypeIssues] # the legacy "orm" objects fall into this category. - # pylint: disable=line-too-long return [object_(element) for element in formatted_json] # pyright: ignore[reportGeneralTypeIssues] return object_(formatted_json) @@ -287,7 +285,6 @@ def get_file_paths_to_upload( def check_file_mime_type(path: str, input_type: str, raise_error=True) -> bool: - # pylint: disable=line-too-long """Returns true if the mime type of the file corresponds to the allowed mime types of the project.""" mime_type = get_mime_type(path.lower()) diff --git a/src/kili/domain/asset/helpers.py b/src/kili/domain/asset/helpers.py index df8560742..46075f0e1 100644 --- a/src/kili/domain/asset/helpers.py +++ b/src/kili/domain/asset/helpers.py @@ -13,7 +13,6 @@ def check_asset_identifier_arguments( asset_id_array: Optional[ListOrTuple[AssetId]], asset_external_id_array: Optional[ListOrTuple[AssetExternalId]], ) -> None: - # pylint: disable=line-too-long """Check that a list of assets can be identified either by their asset IDs or their external IDs.""" if asset_id_array is not None: if asset_external_id_array is not None: diff --git a/src/kili/domain/event.py b/src/kili/domain/event.py index ff0852a99..acb02eb10 100644 --- a/src/kili/domain/event.py +++ b/src/kili/domain/event.py @@ -15,7 +15,6 @@ @dataclass -# pylint: disable=too-many-instance-attributes class EventFilters: """Event filters for running an event search.""" diff --git a/src/kili/entrypoints/cli/project/export.py b/src/kili/entrypoints/cli/project/export.py index 440cff252..d6f8bd885 100644 --- a/src/kili/entrypoints/cli/project/export.py +++ b/src/kili/entrypoints/cli/project/export.py @@ -72,7 +72,6 @@ def export_labels( with_assets: bool, normalized_coordinates: Optional[bool], ) -> None: - # pylint: disable=line-too-long """Export the Kili labels of a project to a given format. \b diff --git a/src/kili/entrypoints/cli/project/import_.py b/src/kili/entrypoints/cli/project/import_.py index dfee01d96..026f0312f 100644 --- a/src/kili/entrypoints/cli/project/import_.py +++ b/src/kili/entrypoints/cli/project/import_.py @@ -33,7 +33,6 @@ def check_asset_type(key: str, value: str, http_client: Optional[HttpClient]) -> def generate_json_metadata(as_frames: bool, fps: Optional[int]): - # pylint: disable=line-too-long """Generate the json_metadata for input of the import_assets service when uploading from a list of path. Args: diff --git a/src/kili/entrypoints/cli/project/member/list_.py b/src/kili/entrypoints/cli/project/member/list_.py index 5566e62d9..f76aa042c 100644 --- a/src/kili/entrypoints/cli/project/member/list_.py +++ b/src/kili/entrypoints/cli/project/member/list_.py @@ -48,7 +48,6 @@ def list_members(api_key: Optional[str], endpoint: Optional[str], project_id: st ) ) members = pd.DataFrame(members_list) - # pylint: disable=line-too-long members = pd.concat([members.drop(["user"], axis=1), members["user"].apply(pd.Series)], axis=1) # type: ignore members = pd.concat( [members.drop(["organization"], axis=1), members["organization"].apply(pd.Series)], diff --git a/src/kili/entrypoints/mutations/asset/__init__.py b/src/kili/entrypoints/mutations/asset/__init__.py index f3d879822..8ac2f8b48 100644 --- a/src/kili/entrypoints/mutations/asset/__init__.py +++ b/src/kili/entrypoints/mutations/asset/__init__.py @@ -211,7 +211,6 @@ def assign_assets_to_labelers( asset_ids: Optional[List[str]] = None, external_ids: Optional[List[str]] = None, ) -> List[Dict[str, Any]]: - # pylint: disable=line-too-long """Assign a list of assets to a list of labelers. Args: diff --git a/src/kili/entrypoints/mutations/plugins/__init__.py b/src/kili/entrypoints/mutations/plugins/__init__.py index d468b9fc3..21da3966c 100644 --- a/src/kili/entrypoints/mutations/plugins/__init__.py +++ b/src/kili/entrypoints/mutations/plugins/__init__.py @@ -150,7 +150,6 @@ def update_webhook( @typechecked def activate_plugin_on_project(self, plugin_name: str, project_id: str) -> Optional[str]: - # pylint: disable=line-too-long """Activates a plugin on a project. Args: @@ -167,7 +166,6 @@ def activate_plugin_on_project(self, plugin_name: str, project_id: str) -> Optio @typechecked def deactivate_plugin_on_project(self, plugin_name: str, project_id: str) -> str: - # pylint: disable=line-too-long """Activates a plugin on a project. Args: diff --git a/src/kili/entrypoints/queries/plugins/__init__.py b/src/kili/entrypoints/queries/plugins/__init__.py index 198780b39..7c19e73b1 100644 --- a/src/kili/entrypoints/queries/plugins/__init__.py +++ b/src/kili/entrypoints/queries/plugins/__init__.py @@ -65,7 +65,6 @@ def get_plugin_logs( limit: int = 100, skip: int = 0, ) -> str: - # pylint: disable=line-too-long """Get paginated logs of a plugin on a project. Args: diff --git a/src/kili/entrypoints/queries/project_user/__init__.py b/src/kili/entrypoints/queries/project_user/__init__.py index 7a04027cf..94e972563 100644 --- a/src/kili/entrypoints/queries/project_user/__init__.py +++ b/src/kili/entrypoints/queries/project_user/__init__.py @@ -182,7 +182,6 @@ def count_project_users( "ORG_ADMIN", ), ) -> int: - # pylint: disable=line-too-long """Count the number of projects and their users that match a set of criteria. Args: diff --git a/src/kili/entrypoints/queries/project_version/__init__.py b/src/kili/entrypoints/queries/project_version/__init__.py index 9f853675c..e4d84e9d6 100644 --- a/src/kili/entrypoints/queries/project_version/__init__.py +++ b/src/kili/entrypoints/queries/project_version/__init__.py @@ -65,7 +65,7 @@ def project_version( Args: project_id: Filter on Id of project fields: All the fields to request among the possible fields for the project versions - See [the documentation](https://docs.kili-technology.com/reference/graphql-api#projectVersions) # pylint:disable=line-too-long + See [the documentation](https://docs.kili-technology.com/reference/graphql-api#projectVersions) for all possible fields. first: Number of project versions to query skip: Number of project versions to skip (they are ordered by their date diff --git a/src/kili/event/presentation/client/event.py b/src/kili/event/presentation/client/event.py index 8d77e7b31..a0544afd5 100644 --- a/src/kili/event/presentation/client/event.py +++ b/src/kili/event/presentation/client/event.py @@ -28,7 +28,6 @@ def list( until_event_id: Optional[str] = None, order: Optional[OrderType] = "asc", ) -> List[EventDict]: - # pylint: disable=line-too-long """List events of my project. Args: diff --git a/src/kili/llm/presentation/client/llm.py b/src/kili/llm/presentation/client/llm.py index 8465e75de..ad134eafc 100644 --- a/src/kili/llm/presentation/client/llm.py +++ b/src/kili/llm/presentation/client/llm.py @@ -50,7 +50,6 @@ def export( label_type_in: Optional[List[LabelType]] = None, status_in: Optional[List[AssetStatus]] = None, ) -> Optional[List[Dict[str, Union[List[str], str]]]]: - # pylint: disable=line-too-long """Returns an export of llm assets with valid labels. Args: @@ -104,7 +103,6 @@ def export( return None def create_model(self, organization_id: str, model: dict) -> ModelDict: - # pylint: disable=line-too-long """Create a new model in an organization. Args: @@ -157,7 +155,6 @@ def create_model(self, organization_id: str, model: dict) -> ModelDict: return self.kili_api_gateway.create_model(model=model_input) def models(self, organization_id: str, fields: Optional[List[str]] = None) -> List[ModelDict]: - # pylint: disable=line-too-long """List models in an organization. Args: @@ -178,7 +175,6 @@ def models(self, organization_id: str, fields: Optional[List[str]] = None) -> Li return list(self.kili_api_gateway.list_models(filters=converted_filters, fields=fields)) def model(self, model_id: str, fields: Optional[List[str]] = None) -> ModelDict: - # pylint: disable=line-too-long """Retrieve a specific model. Args: @@ -198,7 +194,6 @@ def model(self, model_id: str, fields: Optional[List[str]] = None) -> ModelDict: ) def update_properties_in_model(self, model_id: str, model: dict) -> ModelDict: - # pylint: disable=line-too-long """Update properties of an existing model. Args: @@ -251,7 +246,6 @@ def update_properties_in_model(self, model_id: str, model: dict) -> ModelDict: ) def delete_model(self, model_id: str) -> bool: - # pylint: disable=line-too-long """Delete a model from an organization. Args: @@ -268,7 +262,6 @@ def delete_model(self, model_id: str) -> bool: def create_project_model( self, project_id: str, model_id: str, configuration: dict ) -> ProjectModelDict: - # pylint: disable=line-too-long """Associate a model with a project. Args: @@ -365,7 +358,6 @@ def delete_project_model(self, project_model_id: str) -> bool: def create_conversation( self, project_id: str, initial_prompt: str, system_prompt: Optional[str] = None ) -> List[ChatItemDict]: - # pylint: disable=line-too-long """Create a new conversation in an LLM project starting with a user's prompt. This method initiates a new conversation in the specified project by: diff --git a/src/kili/presentation/client/project.py b/src/kili/presentation/client/project.py index 03ac159a3..f223945fb 100644 --- a/src/kili/presentation/client/project.py +++ b/src/kili/presentation/client/project.py @@ -46,7 +46,6 @@ def create_project( tags: Optional[ListOrTuple[str]] = None, compliance_tags: Optional[ListOrTuple[ComplianceTag]] = None, ) -> Dict[Literal["id"], str]: - # pylint: disable=line-too-long """Create a project. Args: diff --git a/src/kili/presentation/client/question.py b/src/kili/presentation/client/question.py index ed6034f29..8e7cae51c 100644 --- a/src/kili/presentation/client/question.py +++ b/src/kili/presentation/client/question.py @@ -24,7 +24,6 @@ def create_questions( asset_id_array: Optional[ListOrTuple[str]] = None, asset_external_id_array: Optional[ListOrTuple[str]] = None, ) -> List[Dict[Literal["id"], str]]: - # pylint:disable=line-too-long """Create questions. Args: diff --git a/src/kili/services/asset_import/base.py b/src/kili/services/asset_import/base.py index 1ecea0224..6316c1c05 100644 --- a/src/kili/services/asset_import/base.py +++ b/src/kili/services/asset_import/base.py @@ -329,7 +329,6 @@ def get_content_type_and_data_from_content( def get_type_and_data_from_content_array( self, content_array: List[Optional[Union[str, bytes]]] ) -> List[Tuple[Union[bytes, str], Optional[str]]]: - # pylint:disable=line-too-long """Returns the data of the content (path) and its content type for each element in the array.""" return list(map(self.get_content_type_and_data_from_content, content_array)) @@ -417,7 +416,6 @@ def upload_json_content_to_bucket(self, assets: List[AssetLike]): ["text/plain"] * len(assets), repeat(self.http_client), ) - # pylint: disable=line-too-long return [AssetLike(**{**asset, "json_content": url}) for asset, url in zip(assets, url_gen)] # type: ignore def import_batch(self, assets: List[AssetLike], verify: bool): @@ -546,7 +544,6 @@ def filter_local_assets(self, assets: List[AssetLike], raise_error: bool): if raise_error: raise if len(filtered_assets) == 0: - # pylint: disable=line-too-long raise ImportValidationError( """No files to upload. Check that the paths exist and file types are compatible with the project.""" ) diff --git a/src/kili/services/export/format/kili/__init__.py b/src/kili/services/export/format/kili/__init__.py index c34762a01..317b9d755 100644 --- a/src/kili/services/export/format/kili/__init__.py +++ b/src/kili/services/export/format/kili/__init__.py @@ -59,7 +59,6 @@ def _save_assets_export(self, assets: List[Dict], output_filename: Path) -> None self.logger.warning(output_filename) def _clean_filepaths(self, assets: List[Dict]) -> List[Dict]: - # pylint: disable=line-too-long """Remove TemporaryDirectory() prefix from filepaths in "jsonContent" and "content" fields.""" for asset in assets: if Path(asset["content"]).is_file(): diff --git a/src/kili/services/label_data_parsing/annotation.py b/src/kili/services/label_data_parsing/annotation.py index 7a46bba41..c16e29e8d 100644 --- a/src/kili/services/label_data_parsing/annotation.py +++ b/src/kili/services/label_data_parsing/annotation.py @@ -282,7 +282,6 @@ def bounding_poly(self) -> BoundingPolyList: return self._json_data["boundingPoly"] -# pylint: disable=line-too-long class EntityInPdfAnnotation(_BaseNamedEntityRecognitionAnnotation, _BaseAnnotationWithBoundingPoly): """Class for parsing the "annotations" key of a job response for named entities recognition in PDFs.""" diff --git a/src/kili/services/label_data_parsing/json_response.py b/src/kili/services/label_data_parsing/json_response.py index 99c896133..40f185fc0 100644 --- a/src/kili/services/label_data_parsing/json_response.py +++ b/src/kili/services/label_data_parsing/json_response.py @@ -142,7 +142,6 @@ def __init__( json_response: Dict, job_names_to_parse: Optional[List[str]] = None, ) -> None: - # pylint: disable=line-too-long """Class for label json response parsing. This class will modify the input json_response. diff --git a/src/kili/services/plugins/upload.py b/src/kili/services/plugins/upload.py index a4ed3d8d2..361b23c6c 100644 --- a/src/kili/services/plugins/upload.py +++ b/src/kili/services/plugins/upload.py @@ -47,7 +47,6 @@ def check_file_mime_type( path: Path, compatible_mime_extensions: List[str], verbose: bool = True ) -> bool: - # pylint: disable=line-too-long """Returns true if the mime type of the file corresponds to one of compatible_mime_extensions.""" mime_type = get_mime_type(path.as_posix()) @@ -167,7 +166,6 @@ def __init__( self.handler_types = None def _retrieve_plugin_src(self) -> List[Path]: - # pylint: disable=line-too-long """Retrieve script from plugin_path and execute it to prevent an upload with indentation errors.""" if self.plugin_path.is_dir(): file_path = self.plugin_path / "main.py" @@ -197,7 +195,6 @@ def _retrieve_plugin_src(self) -> List[Path]: return [file_path] def _retrieve_requirements(self) -> Union[Path, None]: - # pylint: disable=line-too-long """Retrieve script from file_path and execute it to prevent an upload with indentation errors.""" if not self.plugin_path.is_dir(): return None diff --git a/src/kili/use_cases/cloud_storage/azure.py b/src/kili/use_cases/cloud_storage/azure.py index a73de98e4..c59782cb2 100644 --- a/src/kili/use_cases/cloud_storage/azure.py +++ b/src/kili/use_cases/cloud_storage/azure.py @@ -56,7 +56,6 @@ def _split_connection_url_into_storage_account_and_container_name( """Split the connection url into storage account and container name.""" split_value = ".blob.core.windows.net" url_connection = urlparse(connection_url) - # pylint: disable=line-too-long storage_account = url_connection.hostname.split( # pyright: ignore[reportOptionalMemberAccess] split_value )[0] diff --git a/src/kili/utils/labels/geojson/bbox.py b/src/kili/utils/labels/geojson/bbox.py index 030f30863..06e142214 100644 --- a/src/kili/utils/labels/geojson/bbox.py +++ b/src/kili/utils/labels/geojson/bbox.py @@ -135,7 +135,6 @@ def geojson_polygon_feature_to_kili_bbox_annotation( children: Optional[Dict] = None, mid: Optional[str] = None, ) -> Dict[str, Any]: - # pylint: disable=line-too-long """Convert a geojson polygon feature to a Kili bounding box annotation. Args: diff --git a/src/kili/utils/labels/geojson/collection.py b/src/kili/utils/labels/geojson/collection.py index 17d8c07dc..2098fdebf 100644 --- a/src/kili/utils/labels/geojson/collection.py +++ b/src/kili/utils/labels/geojson/collection.py @@ -173,7 +173,6 @@ def kili_json_response_to_feature_collection(json_response: Dict[str, Any]) -> D def geojson_feature_collection_to_kili_json_response( feature_collection: Dict[str, Any], ) -> Dict[str, Any]: - # pylint: disable=line-too-long """Convert a Geojson feature collection to a Kili label json response. Args: diff --git a/src/kili/utils/labels/geojson/line.py b/src/kili/utils/labels/geojson/line.py index 6fb90679f..93d590e91 100644 --- a/src/kili/utils/labels/geojson/line.py +++ b/src/kili/utils/labels/geojson/line.py @@ -89,7 +89,6 @@ def geojson_linestring_feature_to_kili_line_annotation( children: Optional[Dict] = None, mid: Optional[str] = None, ) -> Dict[str, Any]: - # pylint: disable=line-too-long """Convert a geojson linestring feature to a Kili line annotation. Args: diff --git a/src/kili/utils/labels/geojson/point.py b/src/kili/utils/labels/geojson/point.py index 899e3ec88..3df0d8f7b 100644 --- a/src/kili/utils/labels/geojson/point.py +++ b/src/kili/utils/labels/geojson/point.py @@ -82,7 +82,6 @@ def geojson_point_feature_to_kili_point_annotation( children: Optional[Dict] = None, mid: Optional[str] = None, ) -> Dict[str, Any]: - # pylint: disable=line-too-long """Convert a geojson point feature to a Kili point annotation. Args: diff --git a/src/kili/utils/labels/geojson/polygon.py b/src/kili/utils/labels/geojson/polygon.py index 7a20d7a3d..0df81e081 100644 --- a/src/kili/utils/labels/geojson/polygon.py +++ b/src/kili/utils/labels/geojson/polygon.py @@ -150,7 +150,6 @@ def geojson_polygon_feature_to_kili_polygon_annotation( children: Optional[Dict] = None, mid: Optional[str] = None, ) -> Dict[str, Any]: - # pylint: disable=line-too-long """Convert a geojson polygon feature to a Kili polygon annotation. Args: diff --git a/src/kili/utils/labels/geojson/segmentation.py b/src/kili/utils/labels/geojson/segmentation.py index 68233b42a..f0d125eff 100644 --- a/src/kili/utils/labels/geojson/segmentation.py +++ b/src/kili/utils/labels/geojson/segmentation.py @@ -122,7 +122,6 @@ def geojson_polygon_feature_to_kili_segmentation_annotation( children: Optional[Dict] = None, mid: Optional[str] = None, ) -> Dict[str, Any]: - # pylint: disable=line-too-long """Convert a geojson polygon feature to a Kili segmentation annotation. Args: diff --git a/src/kili/utils/logcontext.py b/src/kili/utils/logcontext.py index a8ce25aab..1310665af 100644 --- a/src/kili/utils/logcontext.py +++ b/src/kili/utils/logcontext.py @@ -22,7 +22,6 @@ def __call__(cls, *args, **kwargs): class LogContext(Dict[str, str], metaclass=Singleton): - # pylint: disable=line-too-long """Dict-like singleton that holds the data for the log context, to be passed to the request headers.""" def __init__(self) -> None: