Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Error in Beautifier: Cannot get configuration file for Artistic Style ,etc ?



  • Testing out code Beautifier ... I got following errors when I tried it out on a file.

    Error in Beautifier: Cannot call clang-format or some other error occurred.
    Error in Beautifier: Cannot get configuration file for Artistic Style.


  • Lifetime Qt Champion

    Hi
    Did you install and set it up?
    I think its missing its format file.



  • Sounds great! I did download a file last night that was called clang somethin or other , so I guess I need to download astyle and Uncrustify as well and then set them all to their folder locations.



  • Ok I did a build to get artistic binary file and used
    sudo apt-get install clang-format-3.5

    Error in Beautifier: /home/username/Qt5.7.0/Tools/QtCreator/libexec/qtcreator/clang-3.6: clang-3.6: error: unknown argument: '-style=LLVM'
    clang-3.6: error: no input files


  • Lifetime Qt Champion

    @Lineaxe
    Hi
    I never tried clang-format.
    I do wonder why you seem to install 3.5
    but the errors seems to come from 3.6 ?



  • I haven't tried any of them, but I really like the concept so I will do some digging into it all so I can get it working too :)


  • Lifetime Qt Champion

    @Lineaxe
    Hi
    Just installing
    sudo apt-get install clang-format-3.6
    and point to exe worked for me in linux.



  • Now I wonder why I had the option of pointing to 3.6 ,when I had downloaded 3.5 ?I couldn't pick 3.5 as an option. But of course this makes sense , just get 3.6 :)
    I I found that it was the wrong file that I had been pointing to, you see running the make on the Artistic one built a file called astyle , and I was pointing to that one as well with no luck. I had not found enough info on the subject when I was searching online. Thanks , I will check out getting the other styles workingl. !!



  • Hi, well I used
    sudo apt-get install uncrustify
    to get it installed into usr/bin . I couldn't find a name for artistic style to use with apt-get install , so I downloaded a tar and used make to get a bin.
    I include here the directories for both of them:
    /home/username/astyle/astyle
    /usr/bin/uncrustify
    When I tested them out on a file , I got the following errors:
    Error in Beautifier: Cannot get configuration file for Artistic Style.
    Error in Beautifier: Cannot get configuration file for Uncrustify.

    By looking online I found adding a config for astyle and putting the following into it has worked ,however it now requires an xml documentation file.
    --style=gnu
    Testing atyle again comes up with:
    Error in Beautifier: Cannot open documentation file "/home/username/.config/QtProject/qtcreator/beautifier/documentation/artisticstyle.xml".
    Looks like I keep on opening up whole new projects to keep myself busy !


  • Lifetime Qt Champion

    @Lineaxe
    hi
    This is what i use for Artistic style.
    I just add it directly in Creator with the Add button.



  • Now that seems to work. although I couldn't edit the Documentation text field. No messages coming up for artistic. I am down to getting the format error message problem sofved for Uncrustify . From what I am reading so far on the ones I have working , this stuff looks fairly robust.



  • *.astylerc file must be added in Qt projects' pro file.
    It can be added like any other source file.
    After that, the style file is found automatically by Qt Creator.

    example.pro:

    ...
    SOURCES += style.astylerc
    ...
    

Log in to reply