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 delete wrongly encoded files #285
Conversation
@padjal how do you know that it works? We can't have a script in the repo without a test that covers it. See how other filters are implemented, together with their tests. Also, run |
@yegor256 I added tests and made some small changes to the filter. Please check. |
@yegor256 After I noticed that I have a lint error, I corrected the code so that it confirms the repo standards. Could you run the other workflows? |
@padjal still issues with the build. Try |
@yegor256 I fixed the linting errors. |
@padjal see how other scripts are designed, for example this one: https://github.com/yegor256/cam/blob/master/filters/070-delete-invalid-files.sh It calls |
@yegor256 You are right. I added an executions script for the filter to go through all files. |
@padjal now, it may be reasonable to add a test for this |
@yegor256 I have added a test for the execution script as well. |
@yegor256 As advised by the lint check tool:
, I have changed my code to conform to these requirements and used |
@padjal I believe, the problem now is that you delete not only |
@yegor256 Why do you think that files in the .git directories will also be deleted? What suggestion do you have to mitigate this? |
confidence = result['confidence'] | ||
|
||
if not (encoding in ('ascii', 'UTF-8') and confidence == 1.0): | ||
print('found file', java) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@padjal BTW, this debug line looks redundant
@yegor256 How do you think that we can work around this? If the file has a wrong encoding, then it should be deleted. After all, this is why we created this filter. Another option which I see is to move the filter further back after the move-gits-back filter. What would you suggest? |
@padjal you can just add one more Java file with a broken syntax to the |
@yegor256 That's a good idea. I just added one more file with wrong encoding to the Now one of the other tests doesn't complete. Strange thing is that this same test runs successfully locally. |
@padjal looks good now, thanks! |
Added a script to check for wrongly encoded files as per issue #169