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

Using not deleted #3

Closed
Nerwosolek opened this issue Nov 27, 2020 · 3 comments · Fixed by #9
Closed

Using not deleted #3

Nerwosolek opened this issue Nov 27, 2020 · 3 comments · Fixed by #9
Labels
bug Something isn't working

Comments

@Nerwosolek
Copy link
Contributor

Nerwosolek commented Nov 27, 2020

Duplicate using clause not deleted from output cs file.

@ajakubo1
Copy link
Owner

Is there any chance you can provide me with an example .zip file with the problematic structure so I can replicate it easily? Unless it's like something common. I didn't notice using clauses being duplicated in the example I think (although - to tell you the truth - I didn't test it out with two separate .cs files, I just assumed it works exactly as it does on a python project).

Do remember that this file for C# settings https://github.com/ajakubo1/CGMerger/blob/main/templates/default-csharp/cgmerger.conf is quite important. especially this part, that is matching those using lines:

exclude_line_regex = ^using

or by manually running cgmerge.py --exclude-line-regex ^using

@ajakubo1 ajakubo1 added the bug Something isn't working label Nov 27, 2020
@ajakubo1
Copy link
Owner

Ok, so we analyzed with @Nerwosolek the situation a bit and it turns out that the whole problem is that I open the file without specified encryption and visual studio is adding to all of the files something called BOM https://en.wikipedia.org/wiki/Byte_order_mark - which is completely screwing with the regex (first using is not filtered out). I already have a fix for it and I will create a PR and merge it in a sec.

@ajakubo1
Copy link
Owner

@Nerwosolek - can you confirm that my fix works?

pull the latest changes (lookout though, the templates are gone - I will create another repo for them) and run pip3 install <cgmerger folder>. You will be then able to use the command locally from command line. Just run cgmerger in terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants