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

Add a set of Qt file types (pri, qrc, qss, ui) #755

Merged
merged 2 commits into from
Jun 6, 2023

Conversation

anthony-loiseau-act
Copy link
Contributor

@anthony-loiseau-act anthony-loiseau-act commented Jun 3, 2023

Add few more Qt-related file extensions to known ones:

.pri: They are very closed to already supported .pro files.
pri can also refers to binary files in Window app context, but this is not an issue to mark them as python-like files because reuse enforces .licence file for binary files.

.qrc: Those are Qt XML files containing indexes to resource files.
Added as Uncommentable because Qt Creator IDE rewrites the file when saving, loosing copyrights each time therefore loosing history.

.qss: Qt Style Sheet, based on CSS file format.

.ui: Qt user interface definition file, XML.
Added as Uncommentable because ui files are overwritten by Qt Creator upon saving which looses copyright history.

Add few more Qt-related file extensions to known ones:

.pri: They are very closed to .pro files.
      Unfortunately .pri can also refers to binary files
      in Window app context, hence it is added as Uncommentable.

.qrc: Those are Qt XML files containing indexes to resource files.
      Added as Uncommentable because Qt Creator IDE rewrites the file
      when saving, loosing copyrights each time therefore loosing history.

.qss: Qt Style Sheet, based on CSS file format.

.ui: Qt user interface definition file, XML.
     Added as Uncommentable because ui files are overwritten by
     Qt Creator upon saving which looses copyright history.

Signed-off-by: Anthony Loiseau <anthony.loiseau@allcircuits.com>
Copy link
Member

@linozen linozen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Many thanks!

@carmenbianca
Copy link
Member

I think it's OK to mark .pri with a comment style. I may have to double-check this, but I believe that the program checks anyway whether a given file is binary.

As noted by Carmen Bianca BAKKER within fsfe#755 review,
reuse automatically creates a .license for binary files
ignoring known file extension map.

Therefore binary Windows app .pri file is not an issue
to mark .pri files as python-like files.

I tested with two pri files: one legitimate Qt pri file (text)
and one fake binary pri file. Reuse actually did things as expected,
injecting license in text pri file and as a separate file for the
binary pri file.

Attribution: Carmen Bianca BAKKER
@anthony-loiseau-act
Copy link
Contributor Author

Thanks @carmenbianca for this note, you are right. Reuse header.py is_uncommentable function unconditionally returns true for files detected as binary.
I tested with a legitimate text.pri file and a fake binary.pri file, reuse properly injected licence in text.pri and created binary.pri.license 👍

Therefore I updated my PR to declare Qt pri files as python-like files (as for .pro files)

@linozen
Copy link
Member

linozen commented Jun 6, 2023

Thanks for the update @anthony-loiseau-act. Will merge now!

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

Successfully merging this pull request may close these issues.

3 participants