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

overflow -check crashes when no files are provided #661

Open
Pennycook opened this issue Nov 12, 2024 · 4 comments
Open

overflow -check crashes when no files are provided #661

Pennycook opened this issue Nov 12, 2024 · 4 comments

Comments

@Pennycook
Copy link
Contributor

To reproduce:

$ ./adoc/scripts/reflow.py -check FAIL -nowrite
Traceback (most recent call last):
  File "SYCL-Docs/./adoc/scripts/reflow.py", line 613, in <module>
    folder_to_reflow = conventions.spec_reflow_path
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SYCLConventions' object has no attribute 'spec_reflow_path'

Based on the comments in reflow.py I assume spec_reflow_path is supposed to be set to adoc/chapters/, but I'm not sure. SYCL-Docs also has an adoc/extensions that should be checked.

@gmlueck
Copy link
Contributor

gmlueck commented Nov 12, 2024

I usually run:

./adoc/scripts/verify_reflow_conformance.sh

which is the same script the CI process uses. You can also check a specific file with:

$ ./adoc/scripts/reflow.py adoc/chapters/programming_interface.adoc

@Pennycook
Copy link
Contributor Author

$ ./adoc/scripts/reflow.py adoc/chapters/programming_interface.adoc

This doesn't seem to work for me. I deliberately set up a case that should fail:

diff --git a/adoc/chapters/architecture.adoc b/adoc/chapters/architecture.adoc
index ff3e8d3..85aa530 100644
--- a/adoc/chapters/architecture.adoc
+++ b/adoc/chapters/architecture.adoc
@@ -1895,8 +1895,7 @@ implicitly device copyable.

 Although implementations are not required to support device code that calls
 library functions from the {cpp} core language, some implementations may provide
-device support for some of these functions.
-If the implementation provides device support for one of the following classes,
+device support for some of these functions. If the implementation provides device support for one of the following classes,
 that type is also implicitly device copyable:

   * [code]#std::array<T, 0>#;

Running the check doesn't seem to do anything (but I might be using it incorrectly):

$ ./adoc/scripts/reflow.py adoc/chapters/architecture.adoc
$ echo $?
0

@gmlueck
Copy link
Contributor

gmlueck commented Nov 12, 2024

Running the check doesn't seem to do anything (but I might be using it incorrectly):

Sorry, I didn't give you the right reflow command line. By default, reflow writes the output file into the out directory. If you want it to modify the file in place, you can run like this:

$ ./adoc/scripts/reflow.py -overwrite adoc/chapters/architecture.adoc

You can then check to see what changed via git diff. If you just want to check to see if there are reflow errors, I think it's easier to run verify_reflow_conformance.sh as I show above.

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

3 participants