OpenSCAP / openscap-report

Tool for generating a report from results of oscap scan.
Other
19 stars 9 forks source link

Format man page #102

Closed Honny1 closed 2 years ago

Honny1 commented 2 years ago

This PR improves the format of the man page.

Honny1 commented 2 years ago

/packit build

pep8speaks commented 2 years ago

Hello @Honny1! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 26:100: E501 line too long (156 > 99 characters) Line 28:100: E501 line too long (118 > 99 characters) Line 30:100: E501 line too long (103 > 99 characters) Line 41:100: E501 line too long (133 > 99 characters)

Comment last updated at 2022-08-31 12:57:44 UTC
jan-cerny commented 2 years ago

@Honny1 What has changed? Have you addressed the feedback?

Honny1 commented 2 years ago

@jan-cerny Yes, I have addressed the feedback. I am currently trying to replicate the problem you described in the first place. But I can't reproduce the problem.

Honny1 commented 2 years ago

@jan-cerny I have successfully reproduced the problem with the formatting of command line options. It looks like this is caused by some bug in the old version of the python3-sphinx (4.1.2) package. I'm using python3-sphinx (4.4.0) and it looks fine. What we can do with this problem?

Honny1 commented 2 years ago

@jan-cerny I found the main cause of the problem with the formatting of command line options. In generated man page are missed white spaces before the parameter texts. That's why man does not show the first dash or FILE text.

Here is part of the diff in the man pages generated by the different versions of the packages:

95c97
< .B \-d, \-\-debug
---
> .B\-d, \-\-debug

I am currently working on a fix.

Honny1 commented 2 years ago

@jan-cerny The fix is uploaded. You can test it.

jan-cerny commented 2 years ago

Yes, it could be caused by the version. I'm using python3-sphinx-4.1.2-3.fc35.noarch. But, your fix didn't help, I still have the issue with missing dashes in options in the generated man page. It still generates lines like .B\-d, \-\-debug.

Honny1 commented 2 years ago

@jan-cerny How did you generate a man page? The default behaviour of sphinx-build is to only read and parse source files that are new or have changed since the last run. My fix changed the way how arguments are parsed. So if you just run sphinx-build -b man . TARGET_DIR. Nothing should be changed on the generated man page. I suggest you regenerate the man page with this command sphinx-build -b man -E . TARGET_DIR.

jan-cerny commented 2 years ago

@Honny1 Great! That was it! I was simply expecting that it overwrites existing files. If I do some cleaning and remove them before, it works fine.