Repository: scikit-learn/scikit-learn
Pull request: DOC Fix "Duplicate labels" & "Duplicate .. target" sphinx warn
#### Reference Issues/PRs
Fixes #11533 

#### What does this implement/fix? Explain your changes.

1. ```duplicate label coding-guidelines``` fixed removing the section coding-guidelines from ```contributing.rst``` (this was a duplicate of the same section in ```develop.rst```) 

2. ```duplicate label ``` in "what's new" sections have been fixed following https://github.com/sphinx-doc/sphinx/issues/1668

3. In addition to that 
```duplicate explicit target name``` warnings are fixed following https://github.com/sphinx-doc/sphinx/issues/3921

#### Any other comments?

3. Ask for manually rename the two files included in ```whats_new.rst```, maybe a symbolic link to (e.g.) ```last.inc``` and ```previous.inc``` could be also be a solution? ... but then you have to exclude some ```.rst``` from the build... Anyway this is a fix.. 

Problem statement:
Duplicate Label warnings in sphinx
When building the docs, we get several "duplicate label" warnings. I think that's because we ``include`` some files that are also in the toctree, so the files are there twice. I think it's mostly the datasets, maybe also the whatsnew?

Hints from issue discussion:
I think @jeremiedbb was tackling the datasets.

What's new is harder to fix nicely...
Some warnings are still present on current master:
```
scikit-learn/doc/developers/contributing.rst:774: WARNING: duplicate label coding-guidelines, other instance in /home/cmarmo/software/scikit-learn/doc/developers/develop.rst
scikit-learn/doc/developers/develop.rst:561: WARNING: duplicate label coding-guidelines, other instance in /home/cmarmo/software/scikit-learn/doc/developers/contributing.rst
```
I'm just opening a PR to fix them (together with similar issues)

Commit message: Rename .inc to .rst : Duplicate labels warnings will stay there but manual maintenance is avoided.

Patch to review:
diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst
index e6ccabb18944e..53c340136ba53 100644
--- a/doc/developers/contributing.rst
+++ b/doc/developers/contributing.rst
@@ -349,7 +349,7 @@ complies with the following rules before marking a PR as ``[MRG]``. The
    for any system, but please avoid reformatting parts of the file that your
    pull request doesn't change, as it distracts from code review.
 
-6. Follow the `coding-guidelines`_ (see below).
+6. Follow the :ref:`coding-guidelines`.
 
 7. When applicable, use the validation tools and scripts in the
    ``sklearn.utils`` submodule.  A list of utility routines available
@@ -767,56 +767,6 @@ There are four other tags to help new contributors:
     for new contributors. Note that not all issues which need
     contributors will have this tag.
 
-
-.. _coding-guidelines:
-
-Coding guidelines
-=================
-
-The following are some guidelines on how new code should be written. Of
-course, there are special cases and there will be exceptions to these
-rules. However, following these rules when submitting new code makes
-the review easier so new code can be integrated in less time.
-
-Uniformly formatted code makes it easier to share code ownership. The
-scikit-learn project tries to closely follow the official Python guidelines
-detailed in `PEP8 <https://www.python.org/dev/peps/pep-0008>`_ that
-detail how code should be formatted and indented. Please read it and
-follow it.
-
-In addition, we add the following guidelines:
-
-* Use underscores to separate words in non class names: ``n_samples``
-  rather than ``nsamples``.
-
-* Avoid multiple statements on one line. Prefer a line return after
-  a control flow statement (``if``/``for``).
-
-* Use relative imports for references inside scikit-learn.
-
-* Unit tests are an exception to the previous rule;
-  they should use absolute imports, exactly as client code would.
-  A corollary is that, if ``sklearn.foo`` exports a class or function
-  that is implemented in ``sklearn.foo.bar.baz``,
-  the test should import it from ``sklearn.foo``.
-
-* **Please don't use** ``import *`` **in any case**. It is considered harmful
-  by the `official Python recommendations
-  <https://docs.python.org/2/howto/doanddont.html#from-module-import>`_.
-  It makes the code harder to read as the origin of symbols is no
-  longer explicitly referenced, but most important, it prevents
-  using a static analysis tool like `pyflakes
-  <https://divmod.readthedocs.io/en/latest/products/pyflakes.html>`_ to automatically
-  find bugs in scikit-learn.
-
-* Use the `numpy docstring standard
-  <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_
-  in all your docstrings.
-
-
-A good example of code that we like can be found `here
-<https://gist.github.com/nateGeorge/5455d2c57fb33c1ae04706f2dc4fee01>`_.
-
 .. _backwards-compatibility:
 
 Maintaining backwards compatibility
diff --git a/doc/modules/ensemble.rst b/doc/modules/ensemble.rst
index e4067bb420200..b023b4711c57f 100644
--- a/doc/modules/ensemble.rst
+++ b/doc/modules/ensemble.rst
@@ -456,7 +456,7 @@ trees.
   Scikit-learn 0.21 introduces two new experimental implementations of
   gradient boosting trees, namely :class:`HistGradientBoostingClassifier`
   and :class:`HistGradientBoostingRegressor`, inspired by
-  `LightGBM <https://github.com/Microsoft/LightGBM>`_.
+  `LightGBM <https://github.com/Microsoft/LightGBM>`__.
 
   These histogram-based estimators can be **orders of magnitude faster**
   than :class:`GradientBoostingClassifier` and
@@ -825,7 +825,7 @@ Histogram-Based Gradient Boosting
 Scikit-learn 0.21 introduces two new experimental implementations of
 gradient boosting trees, namely :class:`HistGradientBoostingClassifier`
 and :class:`HistGradientBoostingRegressor`, inspired by
-`LightGBM <https://github.com/Microsoft/LightGBM>`_.
+`LightGBM <https://github.com/Microsoft/LightGBM>`__.
 
 These histogram-based estimators can be **orders of magnitude faster**
 than :class:`GradientBoostingClassifier` and
diff --git a/doc/modules/linear_model.rst b/doc/modules/linear_model.rst
index bf96e30d18f33..26c1b37ced83c 100644
--- a/doc/modules/linear_model.rst
+++ b/doc/modules/linear_model.rst
@@ -217,11 +217,11 @@ the duality gap computation used for convergence control.
 
     * "Regularization Path For Generalized linear Models by Coordinate Descent",
       Friedman, Hastie & Tibshirani, J Stat Softw, 2010 (`Paper
-      <https://www.jstatsoft.org/article/view/v033i01/v33i01.pdf>`_).
+      <https://www.jstatsoft.org/article/view/v033i01/v33i01.pdf>`__).
     * "An Interior-Point Method for Large-Scale L1-Regularized Least Squares,"
       S. J. Kim, K. Koh, M. Lustig, S. Boyd and D. Gorinevsky,
       in IEEE Journal of Selected Topics in Signal Processing, 2007
-      (`Paper <https://web.stanford.edu/~boyd/papers/pdf/l1_ls.pdf>`_)
+      (`Paper <https://web.stanford.edu/~boyd/papers/pdf/l1_ls.pdf>`__)
 
 
 Setting regularization parameter
@@ -385,11 +385,11 @@ the duality gap computation used for convergence control.
 
     * "Regularization Path For Generalized linear Models by Coordinate Descent",
       Friedman, Hastie & Tibshirani, J Stat Softw, 2010 (`Paper
-      <https://www.jstatsoft.org/article/view/v033i01/v33i01.pdf>`_).
+      <https://www.jstatsoft.org/article/view/v033i01/v33i01.pdf>`__).
     * "An Interior-Point Method for Large-Scale L1-Regularized Least Squares,"
       S. J. Kim, K. Koh, M. Lustig, S. Boyd and D. Gorinevsky,
       in IEEE Journal of Selected Topics in Signal Processing, 2007
-      (`Paper <https://web.stanford.edu/~boyd/papers/pdf/l1_ls.pdf>`_)
+      (`Paper <https://web.stanford.edu/~boyd/papers/pdf/l1_ls.pdf>`__)
 
 .. _multi_task_elastic_net:
 
diff --git a/doc/whats_new.rst b/doc/whats_new.rst
index 015677d2b90b7..e0a8231c9ec90 100644
--- a/doc/whats_new.rst
+++ b/doc/whats_new.rst
@@ -24,8 +24,8 @@ Legend for changelogs
 - |API|: you will need to change your code to have the same effect in the
   future; or a feature will be removed in the future.
 
-.. include:: whats_new/v0.22.rst
-.. include:: whats_new/v0.21.rst
+.. include:: whats_new/v0.22.inc
+.. include:: whats_new/v0.21.inc
 
 .. _previous_releases_whats_new:
 


Code review comments:
diff_hunk: @@ -24,8 +24,8 @@ Legend for changelogs
 - |API|: you will need to change your code to have the same effect in the
   future; or a feature will be removed in the future.
 
-.. include:: whats_new/v0.22.rst
-.. include:: whats_new/v0.21.rst
+.. include:: whats_new/v0.22.inc
+.. include:: whats_new/v0.21.inc
path: doc/whats_new.rst
text: @user1:
This would also need reverting.

@author:
Right... sorry... :(
Done