Some source files have no documentation
Closed this issue · 3 comments
Some of the Fortran sources have no comments, for example https://github.com/fortran-lang/stdlib/blob/stdlib-fpm/src/stdlib_stats_corr.f90. I think this was auto-generated with fypp. Does that preclude it from having comments?
@Beliavsky if you look at the original code https://github.com/fortran-lang/stdlib/blob/master/src/stdlib_stats_corr.fypp It has not documentation. fypp enables copying the doc strings, but the problem is simpler, there is no docs to start with
Maybe there should be a rule that no new .fypp or .f90 source file should be committed if it lacks comments. Excluding the source code in the example directory, a list of source files without comments is.
\src\blas\temp\stdlib_blas.f90
\src\lapack\temp\stdlib_lapack_base.f90
\src\lapack\temp\stdlib_lapack_eig_svd_lsq.f90
\src\lapack\temp\stdlib_lapack_orthogonal_factors.f90
\src\lapack\temp\stdlib_lapack_others.f90
\src\lapack\temp\stdlib_lapack_solve.f90
\src\temp\stdlib_linalg_cross_product.f90
\src\temp\stdlib_linalg_diag.f90
\src\temp\stdlib_linalg_outer_product.f90
\src\temp\stdlib_math_all_close.f90
\src\temp\stdlib_math_is_close.f90
\src\temp\stdlib_math_meshgrid.f90
\src\temp\stdlib_stats_corr.f90
\src\temp\stdlib_stats_cov.f90
\src\temp\stdlib_stats_mean.f90
\src\temp\stdlib_stats_moment.f90
\src\temp\stdlib_stats_moment_all.f90
\src\temp\stdlib_stats_moment_mask.f90
\src\temp\stdlib_stats_moment_scalar.f90
\src\temp\stdlib_stats_var.f90
\test\stats\test_corr.f90
A Python script to find such files is
import os
# Set variables (you can modify these)
extension = '.f90'
search_string = '!'
output_file = 'file_list.txt'
# Function to check if file contains the search string
def contains_string(file_path, search_str):
try:
with open(file_path, 'r', encoding='utf-8') as file:
return search_str in file.read()
except (IOError, UnicodeDecodeError):
# Skip files that can't be read (binary files or permission issues)
return False
# Collect matching files
matching_files = []
for root, dirs, files in os.walk('.'):
for file in files:
if file.endswith(extension):
full_path = os.path.abspath(os.path.join(root, file))
if not contains_string(full_path, search_string):
matching_files.append(full_path)
# Write results to output file
with open(output_file, 'w', encoding='utf-8') as f:
for file_path in matching_files:
f.write(f"{file_path}\n")
print(f"List created in {output_file}")
print(f"Full paths of {extension} files without '{search_string}' have been saved.")@Beliavsky @jalvesz, I will include this discussion as part of #944, that also deals with documentation improvement. Thank you.