Skip to content
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

exclude option not working #407

Closed
Koushikphy opened this issue Apr 4, 2022 · 4 comments · Fixed by #408
Closed

exclude option not working #407

Koushikphy opened this issue Apr 4, 2022 · 4 comments · Fixed by #408

Comments

@Koushikphy
Copy link

The exclude option (https://github.com/Fortran-FOSS-Programmers/ford/wiki/Project-File-Options#exclude) not working. I have some source files set as exclude in my ford project file, but they are still shown in the documentation.

I noticed it the same project file works up to ford==6.1.8 but in version 6.1.9-10, the exclude option does not work. Did something change in version 6.1.9 with this option?

@ZedThree
Copy link
Member

ZedThree commented Apr 4, 2022

Do you have an example that reproduces the problem?

@Koushikphy
Copy link
Author

Just to reproduce the problem, I have created this dummy folder with my project file as

---
src_dir: src
github: https://github.com/Koushikphy
email: koushik.naskar9@gmail.com
source: true
sort: src
graph: true
search: true
exclude: test_copy.f90
print_creation_date: true
creation_date: %d %b, %Y
extra_mods: mpi:https://computing.llnl.gov/tutorials/mpi/
            iso_c_binding:http://fortranwiki.org/fortran/show/iso_c_binding
---

Now I have two files with the names test.f90 and test_copy.f90 in the folder src in the same location where the second file is marked as exclude. The content of the file doesn't matter just fill it with "hello world". Now when I compile this with ford the HTML documentation shows both the files, but it should show only the first file.

@ZedThree
Copy link
Member

ZedThree commented Apr 4, 2022

Ah, I see the issue now. That's an easy fix.

Hmm, however, I do think the new behaviour is probably more sensible.
exclude now works like exclude_dir in that the paths are relative to the Ford config file, rather than src_dir. That is, if you wanted to exclude a whole directory, you would have to put:

exclude_dir: src/tests

but for a single file src/exclude_me.f90, it would instead be:

exclude: excluded_file.f90

which seems a bit inconsistent to me. Also, because it previously only checked the filename itself and not the whole path, it excludes any file with the same name, regardless of subdirectory. So if you had src/excluded_file.f90 and src/subdir/excluded_file.f90, both files would be excluded, and there would be no way of just excluding one or the other.

I'll revert the behaviour, but I think a future major version might change this, as well to enable wildcards, which currently aren't possible.

ZedThree added a commit that referenced this issue Apr 4, 2022
Fixes #407

`exclude` excludes files based solely on name and not path. 336075c
changed this to exclude based on path instead
@Koushikphy
Copy link
Author

Okay, got it. That change was fine, I think. But there was no mention of this change in the release and the wiki also says to

Provide only the file-name, not the full path

That's where it got confusing for me. Otherwise, I think giving full pathname is a good choice. Keeps everything explicit. Also the wildcard option would be a nice addition.

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 a pull request may close this issue.

2 participants