Skip to content

Safer linter trigger #124

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Safer linter trigger #124

wants to merge 3 commits into from

Conversation

thomasjpfan
Copy link
Owner

Trigger linter

Copy link

❌ Linting issues

This PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling pre-commit hooks. Instructions to enable them can be found here.

You can see the details of the linting issues under the lint job here


ruff check

ruff detected issues. Please run ruff check --fix --output-format=full locally, fix the remaining issues, and push the changes. Here you can see the detected issues. Note that the installed ruff version is ruff=0.11.7.


doc/conf.py:13:1: I001 [*] Import block is un-sorted or un-formatted
   |
11 |   # serve to show the default.
12 |
13 | / import json
14 | | import os
15 | | import re
16 | | import sys
17 | | import warnings
18 | | from datetime import datetime
19 | | from pathlib import Path
20 | | from urllib.request import urlopen
21 | |
22 | | from sklearn.externals._packaging.version import parse
23 | | from sklearn.utils._testing import turn_warnings_into_errors
   | |____________________________________________________________^ I001
   |
   = help: Organize imports

sklearn/linear_model/_logistic.py:8:1: I001 [*] Import block is un-sorted or un-formatted
   |
 6 |   # SPDX-License-Identifier: BSD-3-Clause
 7 |
 8 | / import numbers
 9 | | import warnings
10 | | from numbers import Integral, Real
11 | |
12 | | import numpy as np
13 | | from joblib import effective_n_jobs
14 | | from scipy import optimize
15 | |
16 | | from sklearn.metrics import get_scorer_names
17 | |
18 | | from .._loss.loss import HalfBinomialLoss, HalfMultinomialLoss
19 | | from ..base import _fit_context
20 | | from ..metrics import get_scorer
21 | | from ..model_selection import check_cv
22 | | from ..preprocessing import LabelBinarizer, LabelEncoder
23 | | from ..svm._base import _fit_liblinear
24 | | from ..utils import (
25 | |     Bunch,
26 | |     check_array,
27 | |     check_consistent_length,
28 | |     check_random_state,
29 | |     compute_class_weight,
30 | | )
31 | |
32 | |
33 | | from ..utils._param_validation import Hidden, Interval, StrOptions
34 | | from ..utils.extmath import row_norms, softmax
35 | | from ..utils.metadata_routing import (
36 | |     MetadataRouter,
37 | |     MethodMapping,
38 | |     _raise_for_params,
39 | |     _routing_enabled,
40 | |     process_routing,
41 | | )
42 | | from ..utils.multiclass import check_classification_targets
43 | | from ..utils.optimize import _check_optimize_result, _newton_cg
44 | | from ..utils.parallel import Parallel, delayed
45 | | from ..utils.validation import (
46 | |     _check_method_params,
47 | |     _check_sample_weight,
48 | |     check_is_fitted,
49 | |     validate_data,
50 | | )
51 | | from ._base import BaseEstimator, LinearClassifierMixin, SparseCoefMixin
52 | | from ._glm.glm import NewtonCholeskySolver
53 | | from ._linear_loss import LinearModelLoss
54 | | from ._sag import sag_solver
   | |____________________________^ I001
55 |
56 |   _LOGISTIC_SOLVER_CONVERGENCE_MSG = (
   |
   = help: Organize imports

sklearn/svm/__init__.py:9:1: I001 [*] Import block is un-sorted or un-formatted
   |
 7 |   # SPDX-License-Identifier: BSD-3-Clause
 8 |
 9 | / from ._bounds import l1_min_c
10 | |
11 | |
12 | |
13 | | from ._classes import SVC, SVR, LinearSVC, LinearSVR, NuSVC, NuSVR, OneClassSVM
   | |_______________________________________________________________________________^ I001
14 |
15 |   __all__ = [
   |
   = help: Organize imports

Found 3 errors.
[*] 3 fixable with the `--fix` option.

ruff format

ruff detected issues. Please run ruff format locally and push the changes. Here you can see the detected issues. Note that the installed ruff version is ruff=0.11.7.


--- doc/conf.py
+++ doc/conf.py
@@ -23,7 +23,6 @@
 from sklearn.utils._testing import turn_warnings_into_errors
 
 
-
 # If extensions (or modules to document with autodoc) are in another
 # directory, add these directories to sys.path here. If the directory
 # is relative to the documentation root, use os.path.abspath to make it

--- sklearn/svm/__init__.py
+++ sklearn/svm/__init__.py
@@ -9,7 +9,6 @@
 from ._bounds import l1_min_c
 
 
-
 from ._classes import SVC, SVR, LinearSVC, LinearSVR, NuSVC, NuSVR, OneClassSVM
 
 __all__ = [

2 files would be reformatted, 921 files already formatted

Generated for commit: e393c3a. Link to the linter CI: here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant