Giter VIP home page Giter VIP logo

Comments (8)

cmacmackin avatar cmacmackin commented on May 26, 2024

I've added this feature and pushed it to the Github repository. I don't plan to put out a new release for it (yet) though, as I'd prefer to have more than just one new feature before I do that (some bugfixes at least). The command-line syntax is -w or --warn to produce the warning messages. Alternatively, placing "warn: " in your project meta-data will do the same thing, so long as some character follows the colon. Unfortunately, there is no easy way to allow it to provide a line number (sorry about that, I realize it would have been useful). Maybe a feature for some other time.

from ford.

szaghi avatar szaghi commented on May 26, 2024

Great Chris.

Don't worry about line number, the warn on name of entity is enough! I will try it late in the morning. Thanks.

from ford.

szaghi avatar szaghi commented on May 26, 2024

Just tested... works great! But there is something that is not well documented...

Let us consider IR_Precision module. The latest ford in warn mode tell me

...
Warning: Undocumented variable MinR16P in file IR_Precision.f90
...

As you can see here the variable is really not documented by Ford, but it has its "own" docstring, see this line 98.

I guess that the problem is due to my bad attitude to use one docstring for more than one variables (that are grouped being similar in some ways). As a matter of fact, line 98 defines two variables, namely MinR16P and MaxR16P, but the docstring is associated only to the last defined variable.

I suppose that it is very difficult to allow many variables sharing the same docstring, this is just a remainder.

Thank you very much for great work.

from ford.

cmacmackin avatar cmacmackin commented on May 26, 2024

This is intended behaviour. When multiple variables are declared on one
line (including the case when line continuations are used), only the
last one will have any documentation associated with it. Other
autodocumentation software seems to have similar behaviour. I must say
that I never really anticipated having one docstring associated with two
separate variables. I don't intend to change this, as it would entail
breaking the API.

On 27/01/15 06:41 AM, Stefano Zaghi wrote:

Just tested... works great! But there is something that is not well
documented...

Let us consider IR_Precision module. The latest ford in warn mode tell me

...
Warning: Undocumented variable MinR16Pin file IR_Precision.f90
...

As you can see here
http://szaghi.github.io/IR_Precision/module/ir_precision.html#var-MinR16P
the variable is really not documented by Ford, but it has its "own"
docstring, see this
https://github.com/szaghi/IR_Precision/blob/master/src/IR_Precision.f90
line 98.

I guess that the problem is due to my bad attitude to use one
docstring for more than one variables (that are grouped being similar
in some ways). As a matter of fact, line 98 defines two variables,
namely |MinR16P| and |MaxR16P|, but the docstring is associated only
to the last defined variable.

I suppose that it is very difficult to allow many variables sharing
the same docstring, this is just a remainder.

Thank you very much for great work.


Reply to this email directly or view it on GitHub
https://github.com/cmacmackin/ford/issues/25#issuecomment-71624778.

Chris MacMackin
Saint Mary's University
Curriculum Vitae http://ap.smu.ca/%7Ecmacmack/CV.pdf

from ford.

szaghi avatar szaghi commented on May 26, 2024

Sure, I agree with you.

This is just a remark for eventual, future improvement.

Thank you again.

from ford.

szaghi avatar szaghi commented on May 26, 2024

Hi Chris,

I have found a possible "false" positive warning.

In FLAP the type bound procedures (e.g. free or check) have their own docstring (e.g. see free one). However, Ford complains with them giving me:

|stefano@zaghi|0|02:26 PM Tue Jan 27|
|~/fortran/FLAP|10 files, 92Kb|
|->~/python/ford/ford.py -w doc/main_page.md 
Reading file ./src/IR_Precision.f90
Reading file ./src/flap_test.f90
Reading file ./src/Lib_Strings.f90
Reading file ./src/Data_Type_Command_Line_Interface.f90
Reading file ./src/Lib_IO_Misc.f90

Warning: Undocumented boundprocedure free in file Data_Type_Command_Line_Interface.f90
Warning: Undocumented boundprocedure check in file Data_Type_Command_Line_Interface.f90
...

Have I done a mistake in documenting the type bound procedure, line 701?

from ford.

cmacmackin avatar cmacmackin commented on May 26, 2024

Okay, this is actually fairly subtle. For bound procedures and module
procedures there are effectively two layers of documentation. One is in
the procedure itself, while the other is where the bound/module
procedure is declared as such. The warning message is complaining that
you haven't documented the latter case.

On 27/01/15 09:36 AM, Stefano Zaghi wrote:

Hi Chris,

I have found a possible "false" positive warning.

In FLAP the type bound procedures
http://szaghi.github.io/FLAP/type/type_command_line_interface.html
(e.g. free or check) have their own docstring (e.g. see free
http://szaghi.github.io/FLAP/proc/free.html one). However, Ford
complains with them giving me:

|stefano@zaghi|0|02:26 PM Tue Jan 27|
|/fortran/FLAP|10 files, 92Kb|
|->
/python/ford/ford.py -w doc/main_page.md
Reading file ./src/IR_Precision.f90
Reading file ./src/flap_test.f90
Reading file ./src/Lib_Strings.f90
Reading file ./src/Data_Type_Command_Line_Interface.f90
Reading file ./src/Lib_IO_Misc.f90

Warning: Undocumented boundprocedure freein file Data_Type_Command_Line_Interface.f90
Warning: Undocumented boundprocedure checkin file Data_Type_Command_Line_Interface.f90
...

Have I done a mistake in documenting the type bound procedure
https://github.com/szaghi/FLAP/blob/master/src/Data_Type_Command_Line_Interface.f90,
line 701?


Reply to this email directly or view it on GitHub
https://github.com/cmacmackin/ford/issues/25#issuecomment-71648139.

Chris MacMackin
Saint Mary's University
Curriculum Vitae http://ap.smu.ca/%7Ecmacmack/CV.pdf

from ford.

szaghi avatar szaghi commented on May 26, 2024

Ok, now it is more clear.

The warnings disappear if the type bound procedure have their own docstrings also into the contains specification.

Thank you Chris.

from ford.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.