Skip to content

Commit 2fc65cc

Browse files
committed
fixes
1 parent a85f7d8 commit 2fc65cc

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ install:
1313
- pip install -r tests/requirements.txt
1414
- python setup.py install
1515
script:
16-
- py.test tests/ --cov=codecov
16+
- py.test tests/test.py --cov=codecov
1717
after_success:
1818
- codecov

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ reinstall:
88
python setup.py install
99

1010
test:
11-
tox
11+
py.test tests/test.py
1212

1313
compare:
1414
hub compare $(shell git tag --sort=refname | tail -1)...master

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ install:
6060
build: false
6161

6262
test_script:
63-
- py.test tests/ --cov=codecov
63+
- py.test tests/test.py --cov=codecov
6464

6565
after_test:
6666
- rm -rf tests/coverages

circle.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99

1010
test:
1111
override:
12-
- nosetests --rednose --with-cov --cov-config=.coveragerc
12+
- py.test tests/test.py --cov=codecov
1313
- codecov
1414

1515
deployment:

codecov/__init__.py

+15-12
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
import requests
77
import argparse
88
from time import sleep
9-
from json import loads, dumps
10-
import xml.etree.cElementTree as etree
9+
from json import loads
1110

1211
try:
1312
from urllib.parse import urlencode
@@ -34,8 +33,6 @@
3433

3534
COLOR = True
3635

37-
remove_ascii = re.compile(r'[^\x00-\x7F]').sub
38-
3936
remove_token = re.compile(r'token=[^\&]+').sub
4037

4138
ignored_path = re.compile(r'(/vendor)|'
@@ -167,6 +164,13 @@ def try_to_run(cmd):
167164
write(' Error running `%s`: %s' % (cmd, str(getattr(e, 'output', str(e)))))
168165

169166

167+
def remove_non_ascii(data):
168+
try:
169+
return data.decode('utf8')
170+
except:
171+
return ''.join([i if ord(i) < 128 else '' for i in data])
172+
173+
170174
def main(*argv, **kwargs):
171175
root = os.getcwd()
172176

@@ -250,7 +254,7 @@ def main(*argv, **kwargs):
250254
# ---------
251255
# Travis CI
252256
# ---------
253-
elif os.getenv('CI') == "true" and os.getenv('TRAVIS') == "true":
257+
elif os.getenv('CI') == 'true' and os.getenv('TRAVIS') == "true":
254258
# http://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
255259
query.update(dict(branch=os.getenv('TRAVIS_BRANCH'),
256260
service='travis',
@@ -275,7 +279,7 @@ def main(*argv, **kwargs):
275279
# --------
276280
# Codeship
277281
# --------
278-
elif os.getenv('CI') == "true" and os.getenv('CI_NAME') == 'codeship':
282+
elif os.getenv('CI') == 'true' and os.getenv('CI_NAME') == 'codeship':
279283
# https://www.codeship.io/documentation/continuous-integration/set-environment-variables/
280284
query.update(dict(branch=os.getenv('CI_BRANCH'),
281285
service='codeship',
@@ -287,8 +291,8 @@ def main(*argv, **kwargs):
287291
# ---------
288292
# Buildkite
289293
# ---------
290-
elif os.getenv('CI') == "true" and os.getenv('BUILDKITE') == 'true':
291-
# https://buildkite.com/docs/guides/environment-variables
294+
elif os.getenv('CI') == 'true' and os.getenv('BUILDKITE') == 'true':
295+
# https://buildkite.com/docs/guides/environment-variables
292296
query.update(dict(branch=os.getenv('BUILDKITE_BRANCH'),
293297
service='buildkite',
294298
build=os.getenv('BUILDKITE_BUILD_NUMBER') + '.' + os.getenv('BUILDKITE_JOB_ID'),
@@ -300,7 +304,7 @@ def main(*argv, **kwargs):
300304
# ---------
301305
# Circle CI
302306
# ---------
303-
elif os.getenv('CI') == "true" and os.getenv('CIRCLECI') == 'true':
307+
elif os.getenv('CI') == 'true' and os.getenv('CIRCLECI') == 'true':
304308
# https://circleci.com/docs/environment-variables
305309
query.update(dict(branch=os.getenv('CIRCLE_BRANCH'),
306310
service='circleci',
@@ -314,7 +318,7 @@ def main(*argv, **kwargs):
314318
# ---------
315319
# Semaphore
316320
# ---------
317-
elif os.getenv('CI') == "true" and os.getenv('SEMAPHORE') == "true":
321+
elif os.getenv('CI') == 'true' and os.getenv('SEMAPHORE') == 'true':
318322
# https://semaphoreapp.com/docs/available-environment-variables.html
319323
query.update(dict(branch=os.getenv('BRANCH_NAME'),
320324
service='semaphore',
@@ -581,10 +585,9 @@ def main(*argv, **kwargs):
581585
'''$(find . -type f -name '*.php' -exec grep -nIH '^[[:space:]]*{' {} \;)\n'''
582586
'''"''')
583587
write(" --> Found %s adjustments" % (adjustments.count('\n') - adjustments.count('\n\n') - 1))
588+
reports = remove_non_ascii(reports)
584589
reports = str(reports) + '\n# path=fixes\n' + str(adjustments) + '<<<<<< EOF'
585590

586-
reports = remove_ascii('', reports)
587-
588591
result = ''
589592
if codecov.dump:
590593
write('-------------------- Debug --------------------')

0 commit comments

Comments
 (0)