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 bear for astyle #388

Closed
Uran198 opened this issue Apr 30, 2016 · 18 comments
Closed

Add bear for astyle #388

Uran198 opened this issue Apr 30, 2016 · 18 comments

Comments

@Uran198
Copy link
Member

@Uran198 Uran198 commented Apr 30, 2016

It's lightweight and supports a lot of languages: http://astyle.sourceforge.net/

@gitmate-bot
Copy link
Collaborator

@gitmate-bot gitmate-bot commented Apr 30, 2016

Thanks for reporting this issue!

Your aid is required, fellow coalaian. Help us triage and solving this issue!

CC @sils1297, @AbdealiJK

@AbdealiJK
Copy link
Contributor

@AbdealiJK AbdealiJK commented Apr 30, 2016

Hasn't been updated since December 2014 though -
https://sourceforge.net/projects/astyle/files/

I don't know how popular it is - if it is still popular we should support it

On Sat, Apr 30, 2016 at 8:28 PM, GitMate notifications@github.com wrote:

Thanks for reporting this issue!

Your aid is required, fellow coalaian. Help us triage and solving this
issue!

CC @sils1297 https://github.com/sils1297, @AbdealiJK
https://github.com/AbdealiJK


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#388 (comment)

@sils
Copy link
Member

@sils sils commented May 6, 2016

astyle was quite popular IIRC, it supports more languages than we do right now so maybe this is a quick and nice thing?

@sils sils added this to the 0.3 milestone May 6, 2016
@sils sils removed this from the 0.3 milestone May 15, 2016
ivange94 added a commit to ivange94/coala-bears that referenced this issue Nov 5, 2016
Add a linter bear for the Artistic Style linter

Closes coala#388
ivange94 added a commit to ivange94/coala-bears that referenced this issue Nov 6, 2016
Add a linter bear for the Artistic Style linter

Closes coala#388
@sils
Copy link
Member

@sils sils commented Nov 22, 2016

@ivange94 any progress here?

@ivange94
Copy link
Contributor

@ivange94 ivange94 commented Nov 22, 2016

I have actually looked at this just once. Sorry if I am blocking anyone but
I am really interesting in completing this. I'll be traveling for a
conference 4th December and it was so sudden hence I was not prepared and I
am trying to rush things now. I did not even have a passport. Then I have
internships too. But I will secure sometime and complete this before the
end of the week. I have already done some research and it would be a waste
of time for me to leave now.

On Tue, Nov 22, 2016 at 11:25 AM, Lasse Schuirmann <notifications@github.com

wrote:

@ivange94 https://github.com/ivange94 any progress here?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#388 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKzjvtd1OiKb0kdZ0rmM9fvJ3RiFmuwQks5rAsMugaJpZM4ITa9V
.

Software Engineering Student, University of Buea
Software Developer (Volunteer), OpenMRS
GSoC Veteran
Help Desk Manager, OpenMRS

@sils
Copy link
Member

@sils sils commented Nov 22, 2016

@sils
Copy link
Member

@sils sils commented Nov 22, 2016

setting importance to high because this adds missing auto frmatting correction for some languages.

@Nosferatul
Copy link
Member

@Nosferatul Nosferatul commented Dec 13, 2016

@ivange94 ping

ivange94 added a commit to ivange94/coala-bears that referenced this issue Dec 15, 2016
Add a linter bear for the Artistic Style linter

Closes coala#388
@ivange94
Copy link
Contributor

@ivange94 ivange94 commented Dec 15, 2016

AStyleLintBear wipes out the contents of the file. Right now I just have a simple implementation without a lot of options set. But everytime I run the bear and select auto apply patch, the contents of the file get wiped. Actually this is what I was having the first time I tried this some days ago and I talked to @Makman2 on gitter. And he said what is happening is that the astyle linter automatically changes the file instead of printing the changes to the standart output but the @LINTER decorator is expecting deteced changes to be printed. So he asked me to look for a switch that will prevent the file from been touched and one that prints the formatting changes to the std instead of touching the file. I have found no switch displays the formatting changes to the standard. With astyle to display formatting changes to standard output without touching the file, you use a pipe and a redirect instead of a switch.

e.g astyle --style=allman < test.cpp | less

Still trying to figure out what to do here. Don't know if there is another rout I can take to stop @LINTER decorator from wiping out the file.

you can view the code here ivange94@bea32b0

@Makman2
Copy link
Member

@Makman2 Makman2 commented Dec 15, 2016

@linter tries to read a corrected version of the file from stdout, but there's none, that's why it wipes the file. Use stderr if this is the correct stream.

Btw: you can't use redirects, piping and other shell features, as shell-execution is disabled for security reasons.

ivange94 added a commit to ivange94/coala-bears that referenced this issue Dec 24, 2016
Add a linter bear for the Artistic Style linter

Closes coala#388
@ivange94
Copy link
Contributor

@ivange94 ivange94 commented Dec 24, 2016

@Makman2 as per your suggestion on gitter, I tried different combinations of use_stderr and use_stdout but it still did not work. When I run the bear, and select apply patch. The contents of the file still get wiped. They are replaced with the message "Formatted file_name.cpp"

@Makman2
Copy link
Member

@Makman2 Makman2 commented Dec 24, 2016

@ivange94 did you use use_stdin?

ivange94 added a commit to ivange94/coala-bears that referenced this issue Dec 24, 2016
Add a linter bear for the Artistic Style linter

Closes coala#388
@ivange94
Copy link
Contributor

@ivange94 ivange94 commented Dec 24, 2016

@Makman2 Yes. This is what I did ivange94@acdbf91. Still not working.

@ivange94
Copy link
Contributor

@ivange94 ivange94 commented Dec 29, 2016

@Makman2 not sure how to proceed as using use_stdin, use_stdout, use_stderr, didn't help.

@Makman2
Copy link
Member

@Makman2 Makman2 commented Dec 29, 2016

I'm looking at it today 👍

@Makman2 Makman2 self-assigned this Dec 29, 2016
@Makman2
Copy link
Member

@Makman2 Makman2 commented Dec 29, 2016

See gitter:

When astyle detects stdin, it outputs stuff to stdout. This is how create_arguments has to look like to start a default astyle run, no need for shell :)

@linter(...,
        use_stdin=True):
class AstyleBear:
    ...
    @staticmethod
    def create_arguments(filename, file, config_file):
        return '--dry-run',
@Makman2 Makman2 removed their assignment Dec 29, 2016
@ivange94
Copy link
Contributor

@ivange94 ivange94 commented Mar 9, 2017

I should be unassigned. Can't find the time to complete this.

yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jun 30, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 2, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 2, 2017
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 2, 2017
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 3, 2017
Closes coala#388
@yash-nisar yash-nisar mentioned this issue Jul 3, 2017
0 of 2 tasks complete
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 3, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 5, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 6, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 6, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 6, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 6, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 6, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 6, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 11, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 11, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 11, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 11, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 19, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 19, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 21, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 21, 2017
Closes coala#388
yash-nisar added a commit to yash-nisar/coala-bears that referenced this issue Jul 21, 2017
Closes coala#388
@rultor rultor closed this in #1882 Jul 21, 2017
umeshksingla added a commit to umeshksingla/coala-bears that referenced this issue Sep 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

9 participants
You can’t perform that action at this time.