Skip to content

Conversation

@lrineau
Copy link
Member

@lrineau lrineau commented Jan 5, 2026

Summary of Changes

Modernize and fix pylint warnings and errors.

Release Management

  • Affected package(s): Documentation
  • License and copyright ownership: N/A. maintenance by GF

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes two Python scripts in the Documentation directory to fix pylint warnings and errors. The changes focus on improving code quality by adopting modern Python best practices while maintaining the same functionality.

Key Changes:

  • Replaced deprecated codecs module with built-in open() function for UTF-8 file handling
  • Added proper context managers (with statements) for file operations to ensure files are properly closed
  • Added docstrings to functions and modules for better code documentation
  • Updated variable naming from camelCase to snake_case (e.g., citeDiccite_dict, foundDoublefound_double)
  • Modernized string formatting by using f-strings and splitting long strings for better readability

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
Documentation/doc/scripts/pkglist_filter.py Modernized file handling with context managers, removed codecs import, added module and function docstrings, fixed indentation to 4 spaces, and improved variable naming
Documentation/doc/scripts/generate_how_to_cite.py Removed codecs import, converted to context managers for file operations, renamed variables to snake_case, split long strings for line length compliance, updated one assertion to use f-string formatting, and reformatted multi-line strings
Comments suppressed due to low confidence (2)

Documentation/doc/scripts/generate_how_to_cite.py:78

  • Unnecessary string concatenation with += operator. The RESULT_TXT constant is split into two parts where the first part is a tuple concatenation (lines 20-26) and then line 27 adds more content with +=. This could be simplified by using a single multi-line string or by including all content in the initial tuple concatenation for better readability and consistency.
RESULT_TXT = (
    r"""// This file was generated by generate_how_to_cite.py. """
    r"""You shouldn't modify it directly.

/*!
\page how_to_cite_cgal Acknowledging %CGAL"""
)
RESULT_TXT += r"""

\details \cgal is implemented for the most part by researchers. The
academic world evaluates and rewards researchers for a good part by
the analysis of the number of published papers and the number of
citations of their papers, which measures their impact. In order to
make the \cgal project attractive for researchers to contribute their
work (which allows users to benefit from new contributions), we are
pushing a model where the \cgal manual chapters are considered like
publications, and can be cited in articles as such.

We therefore kindly ask users to cite \cgal as appropriately as
possible in their papers, and to mention the use of \cgal on the web
pages of their projects using \cgal and provide us with links to these
web pages. Feel free to contact us in case you have any question or
remark on this topic.

We provide bibtex entries for the chapters of the User and Reference
Manual, as well as for publications directly related to the \cgal
software.

## Citing the %CGAL Library or the %CGAL project ##

If you want to cite the \cgal Library or project as a whole, please

- cite: \cgal, Computational Geometry Algorithms Library, https://www.cgal.org
- use the first bibtex entry from the file <a href="how_to_cite_cgal.bib">how_to_cite_cgal.bib</a>.

## Citing the User and Reference Manual ##

If you want to refer to \cgal manual, please cite the appropriate
  entry from the bibliographic entries for individual chapters listed
  in the table below.

<table>

<tr valign="top">
<td align="right" class="bibtexnumber">
[<a name="cgal:eb-${CGAL_RELEASE_YEAR_ID}">1</a>]
</td>
<td class="bibtexitem">
The \cgal Project.
 <em>\cgal User and Reference Manual</em>.
 \cgal Editorial Board, ${CGAL_CREATED_VERSION_NUM} edition, ${CGAL_BUILD_YEAR4}.
</td><td width="75px">[&nbsp;<a href="how_to_cite.html#cgal:eb-${CGAL_RELEASE_YEAR_ID}">bib</a>&nbsp;|
<a href="packages.html">http</a>&nbsp;]

</td>
</tr>


"""

Documentation/doc/scripts/generate_how_to_cite.py:97

  • Unnecessary string concatenation with += operator. The PRE_HTML constant is split into two parts where the first part is a tuple concatenation (lines 83-87) and then line 88 adds more content with +=. This could be simplified by using a single multi-line string or by including all content in the initial tuple concatenation for better readability and consistency.
PRE_HTML = (
    r"""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" """
    r""""https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">"""
)
PRE_HTML += r"""
<head>
<link rel="icon" type="image/png" href="../Manual/g-196x196-doc.png"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<link href="cgal_stylesheet.css" rel="stylesheet" type="text/css" />
<title>CGAL ${CGAL_CREATED_VERSION_NUM} - Manual: Acknowledging CGAL</title>
</head>
<body>
"""

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lrineau lrineau added this to the 6.2-beta milestone Jan 5, 2026
@MaelRL MaelRL requested a review from sloriot January 17, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant