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

improvements for checkpars.py #53

Closed
teuben opened this issue May 4, 2021 · 19 comments
Closed

improvements for checkpars.py #53

teuben opened this issue May 4, 2021 · 19 comments

Comments

@teuben
Copy link
Owner

teuben commented May 4, 2021

Now that we have a functional checkpars.py, we need a few enhancements: thanks @ParkerTewell for an excellent first version

  1. script needs to made "chmod +x ", but via git: git update-index --chmod=+x install.sh
    after this a regular commit push.

  2. I see a few programs with the output "man: None". Does this mean the man page doesn't exist. But I see a None for ccdmom, and the man page exists. There are a few more like this. But other "None" are indeed for missing man pages.

  3. Add a "-h" which reminds the user of the valid options, and then exit the program. Could also report a version, as most scripts and programs report that in the inline help option

  4. we already spoke about a "-f tasklist" where tasklist needs to be a valid file (either absolute or relative path)

  5. currently the script needs to be executed from src/scripts, but if the default tasklist is $NEMO/src/scripts/tasklist it can be from anywhere. use os.environ['NEMO'] to get $NEMO

@teuben
Copy link
Owner Author

teuben commented May 5, 2021

Another option would check the description in the .SH NAME field of the man page, with the output of the "help=u" line. I would like to argue that they should be the same. For example for ccdfits they differ by one word :-)

@ParkerTewell
Copy link
Contributor

-h flag implemented

@teuben
Copy link
Owner Author

teuben commented May 20, 2021

minor request: in the output it says "man" and "help", which means the output in the two rows is mis-aligned. if we rename "help" to "bin", they will align and it still reflects where it came from.

@teuben
Copy link
Owner Author

teuben commented May 21, 2021

The output says
Files read: 159
Bad files found: 78
but it really presumably found 159 of the (currently) 208 in the tasklist in $NEMOBIN. Once the -f flag is implemented, at the same time we should add this info, maybe the first line should read:
Entries found: 208 in ....

@teuben
Copy link
Owner Author

teuben commented May 24, 2021

I'm not sure if the merge from checkpars (about the chmod +x) worked. My example above was also wrong, i referred to install.sh, but it should have been checkpars.py. I repeated this experiment in my master branch, so your next edit should start from this.

@ParkerTewell
Copy link
Contributor

ParkerTewell commented May 24, 2021

checkpars returns None when it either 1) fails to read the man file, or 2) fails to find a keyword in the line following a .TP, I can change it to print something else based on the case.

I've changed the function to return None when it fails to read the man page and "Non-conformant" when it fails to read a keyword after a .TP line

@teuben
Copy link
Owner Author

teuben commented May 24, 2021

yes, it would be useful to print something different in the two cases.
I already found one file where the .TP was forgotten!

@teuben
Copy link
Owner Author

teuben commented May 24, 2021

ccdppm.1 was flagged as non-conformant, but I think it may be because the last keyword is "8bit=" and there is a problem with scanning keyword names when a non-alpha character is in the name. I had several false negatives in that category.

@ParkerTewell
Copy link
Contributor

Changed help to bin
Implemented -f flag
What's left:

  1. scanning numeric keywords bug
  2. changing the environment to $NEMO using os.environ['NEMO']

@teuben
Copy link
Owner Author

teuben commented Jun 9, 2021

Also to fix:
If a line in the 'help=h' output starts with a space, skip it. Look at 'runbody1 help=h'

@ParkerTewell
Copy link
Contributor

help=h now skips lines that start with spaces
Also added support to process hashtags, underscores, and numeric characters when scanning man pages.
Up next: support for relative paths for -f

@ParkerTewell
Copy link
Contributor

Added -f support plus lots of other stuff.
What's next?

@teuben
Copy link
Owner Author

teuben commented Jul 4, 2021

Once we have a robust way where the -v option works, we could also have an option to check the usage line, e.g. with a new -u flag. Here's my thoughts on this.

Each program has a one line description. E.g. "man tsf" shows
tsf - type a stuctured file
in the .SH "NAME" field.

The "tsf help=h" shows it slightly different:
type contents of a (binary) structured file

The $NEMO/src/scripts/tasklist also has an entry, because "mknemo" has a method to maintain this list. The mknemo script will update a temporary file in $NEMO/etc/tasklist, and once every while I will mere new/uniq entries in the master list in $NEMO/src/scripts/tasklist

There's more behind this. This tasklist is also something in a wider circle , outside of NEMO, to allow a google type search one level deeper than the description of NEMO.

@teuben
Copy link
Owner Author

teuben commented Jul 4, 2021

I did find a .SH scanning error. Look at the report on scanfits. Various .TP items in the ".SH FIXES" portion of the man page seem to think they are keywords (ING, TUCSON, etc.)
I also try fooling it by putting a space before, the \fBING\fP but that also didn't get it fixed.

@ParkerTewell
Copy link
Contributor

added -u flag

@ParkerTewell
Copy link
Contributor

To Do:
Fix checkpars so it can be run anywhere

@ParkerTewell
Copy link
Contributor

Anymore improvements?

@teuben
Copy link
Owner Author

teuben commented Jul 30, 2022

can you check the man page (checkpars.8), overall if it's correct, and there is a statement that it can only be run from $NEMO. Also the EXAMPLE should have a line "cd $NEMO" before the "make" line.

@ParkerTewell
Copy link
Contributor

Good to close this issue?

@teuben teuben closed this as completed Aug 2, 2022
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

No branches or pull requests

2 participants