-
Notifications
You must be signed in to change notification settings - Fork 581
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
PHPCodeBeautifierBear: Add PHPCodeBeautifierBear #2156
base: master
Are you sure you want to change the base?
Conversation
c9cf9ff
to
12c1da7
Compare
12c1da7
to
b1eb249
Compare
b1eb249
to
450a52c
Compare
02b306d
to
f94558c
Compare
f94558c
to
f035fe6
Compare
3b118e3
to
ca19565
Compare
@SanketDG I made the required changes |
.travis.yml
Outdated
@@ -103,6 +103,9 @@ before_install: | |||
sed -i.bak '/^coala/d' requirements.txt | |||
sed -i.bak '/^mypy-lang/d' requirements.txt bear-requirements.txt | |||
fi | |||
# On ubuntu:14.04 this seems the best way to install `phpcbf` | |||
# With ubuntu:16.04 `php-codesniffer` contains `phpcbf` | |||
- sudo pear install PHP_CodeSniffer |
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.
can you use the newer composer here?
also, you have to put this in a new shell script, .ci/deps.composer.sh
, look at other package manager shell scripts to see how it is done
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.
but still this needs to be moved preferably to .ci/deps.sh
Just realised its already there https://github.com/coala/coala-bears/blob/master/.ci/deps.apt.sh#L28 since we have the codesniffer bear, so you dont need anything in |
@SanketDG No that was the problem actually with |
@bhavishyagopesh that makes sense, it probably carries an old version, I am up for using pear right now and then move to composer when #2187 is implemented. |
@SanketDG If you say, I tested the composer setup locally just now(inside ubuntu docker), I can add the |
2c1f830
to
2e9e2bd
Compare
yup that would be a separate PR |
c09d423
to
8ca602c
Compare
79c0ce1
to
e223ae1
Compare
@SanketDG the appveyor ci fails because of missing |
bears/php/PHPCodeBeautifierBear.py
Outdated
return os.path.join(os.path.dirname(__file__), name) | ||
|
||
|
||
def load_testfile(name): |
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.
If you have a look at other bears these 2 methods (get_testfile_path
and load_testfile
) are used in the test files of bear and not the file that wraps the linter. So these 2 function names didn't make sense to me when I first read your code and then I realized that you use them to load the sample config file (if I'm not wrong). So I think it would be better to rename these methods as get_configfile_path
and load_configfile
respectively. It would make much more sense to someone who reads your code in the future. 😄
e223ae1
to
92f3805
Compare
Adds `PHPCodeBeautifierBear` that supports detection and fixing of php code. Closes coala#1771
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.
IMO it takes the pear to be pre installed which is not the case, so u need to install the pear.
I have no idea how to add |
@@ -39,6 +39,7 @@ install: | |||
# Check that we have the expected version and architecture for Python | |||
- "python --version" | |||
- "python -c \"import struct; print(struct.calcsize('P') * 8)\"" | |||
- "pear install PHP_CodeSniffer" |
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.
add the skip decorator to your test class, so you dont need to install pear onto windows.
Adds
PHPCodeBeautifierBear
that supports detection andfixing of php code.
Closes #1771
For short term contributors: we understand that getting your commits well
defined like we require is a hard task and takes some learning. If you
look to help without wanting to contribute long term there's no need
for you to learn this. Just drop us a message and we'll take care of brushing
up your stuff for merge!
Checklist
them.
individually. It is not sufficient to have "fixup commits" on your PR,
our bot will still report the issues for the previous commit.) You will
likely receive a lot of bot comments and build failures if coala does not
pass on every single commit!
After you submit your pull request, DO NOT click the 'Update Branch' button.
When asked for a rebase, consult coala.io/rebase
instead.
Please consider helping us by reviewing other peoples pull requests as well:
cobot mark wip <URL>
to get it outof the review queue.
The more you review, the more your score will grow at coala.io and we will
review your PRs faster!