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

Substitute illegal characters in filename to hyphen #479

Merged
merged 9 commits into from
Jun 29, 2023

Conversation

rtgdk
Copy link
Collaborator

@rtgdk rtgdk commented Jun 29, 2023

Fixing #376

Changes on top of #460

Works for other illegal characters as well like SPDXTagExample-v2.2:#%rohit.spdx

Screenshot 2023-06-29 at 6 45 30 PM

All illegal characters list taken from - https://www.mtu.edu/umc/services/websites/writing/characters-avoid/

@rtgdk
Copy link
Collaborator Author

rtgdk commented Jun 29, 2023

@goneall @BanulaKumarage Please review.

@@ -66,7 +66,7 @@ def license_compare_helper(request):
base_url=urljoin(settings.MEDIA_URL, folder+'/')
)
for myfile in request.FILES.getlist("files"):
filename = fs.save(myfile.name, myfile)
filename = fs.save(utils.removeSpecialCharacters(myfile.name), myfile)
Copy link

Choose a reason for hiding this comment

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

6% of developers fix this issue

E501: line too long (86 > 79 characters)

❗❗ 3 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
src/app/core.py 209
src/app/core.py 319
src/app/core.py 491

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.

@@ -17,6 +17,7 @@
import logging
import re
import socket
import unicodedata
Copy link

Choose a reason for hiding this comment

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

9% of developers fix this issue

F401: 'unicodedata' imported but unused


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.

@@ -17,6 +17,7 @@
import logging
import re
import socket
import unicodedata
Copy link

Choose a reason for hiding this comment

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

20% of developers fix this issue

vulture-90: unused import 'unicodedata'


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.

@goneall
Copy link
Member

goneall commented Jun 29, 2023

Thanks @rtgdk and @BanulaKumarage

I'll merge this in for the next release.

@goneall goneall merged commit 142af11 into main Jun 29, 2023
1 check failed
@goneall goneall deleted the BanulaKumarage-Fixing-#376 branch June 29, 2023 23:23
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.

None yet

3 participants