internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: vnpy/vnpy

Issue:
QuantosDataService\dataService.py时间提前一分钟错误
## 环境
C:\Projects\vnpy1.8.1\examples\QuantosDataService\dataService.py

## Issue类型
三选一：Bug

## 预期程序行为
quantOS给的one minute bar的时间戳是结束点，vn.py尝试转换为开始点
如11：30分的数据转换为11：29

## 实际程序行为
正常时间段都没错
在夜盘0：00时，VN.PY将时间调为23：59，，但人家quantOS的日期为次日了，此时日期没有回滚

## 重现步骤

##改进
建议引入datetime对象，然后delta1分钟，然系统自动处理时间回滚
因为有例外，不能日期简单减一，如果前一日是非交易日怎么办（可能这中情况现实中不会发生）


Discussion:
generateVtBar()里面负责回退日期
如果前一日是一个月的最后一天31号
C:\Projects\vnpy1.8.1\examples\QuantosDataService\dataService.py 第 72行位置插入如下代码快
本人修改：
```python
#------------------------------add by yzl :start
#print(row.date, type(row.date), row.time, type(row.time))# add by yzl to show the date type and value
#20180328 < type'long' > 93400 < type'long' >
#最佳改进方法： 构建一个datetime,然后滞后一分钟，不能简单0：00：00处理，日期减一，弊端:处理量太大
#改进2：找出 0：00,此时日期回退一天
if int(hour) == 0 and int(minute) == 0:
     temp_date = datetime(int(bar.date[:4]), int(bar.date[4:6]), int(bar.date[6:])).date()
    temp_date = temp_date - timedelta(days=1)
    bar.date = temp_date.strftime("%Y%m%d")

# -------------------------------add by yzl :end

```
还不会github不然直接push到github了

Resolving patch:
diff --git a/examples/QuantosDataService/dataService.py b/examples/QuantosDataService/dataService.py
--- a/examples/QuantosDataService/dataService.py
+++ b/examples/QuantosDataService/dataService.py
@@ -62,7 +62,6 @@ def generateVtBar(row):
     bar.low = row['low']
     bar.close = row['close']
     bar.volume = row['volume']
-    
     bar.date = str(row['date'])
     bar.time = str(row['time']).rjust(6, '0')
    
@@ -70,6 +69,19 @@ def generateVtBar(row):
     hour=bar.time[0:2]
     minute=bar.time[2:4]
     sec=bar.time[4:6]
+
+    # ------------------------------add by yzl :start
+    # print(row.date, type(row.date), row.time, type(row.time))# add by yzl to show the date type and value
+    # 20180328 < type'long' > 93400 < type'long' >
+    # 最佳改进方法： 构建一个datetime,然后滞后一分钟，不能简单0：00：00处理，日期减一，弊端:处理量太大
+    # 改进2：找出 0：00,此时日期回退一天
+    if int(hour) == 0 and int(minute) == 0:
+        temp_date = datetime(int(bar.date[:4]), int(bar.date[4:6]), int(bar.date[6:])).date()
+        temp_date = temp_date - timedelta(days=1)
+        bar.date = temp_date.strftime("%Y%m%d")
+
+    # -------------------------------add by yzl :end
+
     if minute=="00":
         minute="59"
         
@@ -81,6 +93,8 @@ def generateVtBar(row):
     else:
         minute=str(int(minute)-1).rjust(2,'0')
     bar.time=hour+minute+sec
+
+
    
     bar.datetime = datetime.strptime(' '.join([bar.date, bar.time]), '%Y%m%d %H%M%S')
     


Test patch:
Repository: vnpy/vnpy

Issue:
tick级别数据在vnpy1.8.1版本下无法回测，原因是源码中filter的参数错误
## 环境

* 操作系统: 如Windows 10
* Anaconda版本: 如Anaconda 4.0.0 Python 2.7 32位
* vn.py版本: 如v1.7发行版或者dev branch 20170920（下载日期）

## Issue类型
三选一：Bug

## 预期程序行为
无报错

## 实际程序行为
报错NoneType object does not have attribute 'lastPrice'

## 重现步骤
tick策略的回测
问题出在/vnpy/trader/app/ctaStrategy/ctaBacktesting.py——loadHIstoryData()
![image](https://user-images.githubusercontent.com/22017570/44001111-47a2bba0-9e5e-11e8-98a8-055cb2334ecd.png)


针对Bug类型Issue，请提供具体重现步骤以及报错截图



Discussion:

Resolving patch:
diff --git a/vnpy/__init__.py b/vnpy/__init__.py
--- a/vnpy/__init__.py
+++ b/vnpy/__init__.py
@@ -1,4 +1,4 @@
 # encoding: UTF-8
 
-__version__ = '1.8.1'
+__version__ = '1.9.0'
 __author__ = 'Xiaoyou Chen'
\ No newline at end of file
diff --git a/vnpy/trader/app/ctaStrategy/ctaBacktesting.py b/vnpy/trader/app/ctaStrategy/ctaBacktesting.py
--- a/vnpy/trader/app/ctaStrategy/ctaBacktesting.py
+++ b/vnpy/trader/app/ctaStrategy/ctaBacktesting.py
@@ -615,6 +615,11 @@ def calculateBacktestingResult(self):
         """
         self.output(u'计算回测结果')
         
+        # 检查成交记录
+        if not self.tradeDict:
+            self.output(u'成交记录为空，无法计算回测结果')
+            return {}
+        
         # 首先基于回测后的成交记录，计算每笔交易的盈亏
         resultList = []             # 交易结果列表
         
@@ -971,6 +976,11 @@ def calculateDailyResult(self):
         """计算按日统计的交易结果"""
         self.output(u'计算按日统计结果')
         
+        # 检查成交记录
+        if not self.tradeDict:
+            self.output(u'成交记录为空，无法计算回测结果')
+            return {}
+        
         # 将成交添加到每日交易结果中
         for trade in self.tradeDict.values():
             date = trade.dt.date()
@@ -1333,6 +1343,7 @@ def runHistoryDataServer():
     hds.start()
 
     print(u'按任意键退出')
+    hds.stop()
     raw_input()
 
 #----------------------------------------------------------------------
diff --git a/vnpy/trader/app/spreadTrading/stEngine.py b/vnpy/trader/app/spreadTrading/stEngine.py
--- a/vnpy/trader/app/spreadTrading/stEngine.py
+++ b/vnpy/trader/app/spreadTrading/stEngine.py
@@ -196,13 +196,7 @@ def processTradeEvent(self, event):
         spread.calculatePos()
         
         # 推送价差持仓更新
-        event1 = Event(EVENT_SPREADTRADING_POS+spread.name)
-        event1.dict_['data'] = spread
-        self.eventEngine.put(event1)
-        
-        event2 = Event(EVENT_SPREADTRADING_POS)
-        event2.dict_['data'] = spread
-        self.eventEngine.put(event2)
+        self.putSpreadPosEvent(spread)
     
     #----------------------------------------------------------------------
     def processPosEvent(self, event):


Test patch:
Repository: vnpy/vnpy

Issue:
fileHandler 加上编码
    def addFileHandler(self, filename=''):
            self.fileHandler = logging.FileHandler( filename=filepath, mode='w', encoding='utf-8' )

这样很多字符都可以写得上。


Discussion:

Resolving patch:
diff --git a/vnpy/api/okex/vnokex.py b/vnpy/api/okex/vnokex.py
--- a/vnpy/api/okex/vnokex.py
+++ b/vnpy/api/okex/vnokex.py
@@ -6,6 +6,7 @@
 import hashlib
 import json
 import traceback
+import zlib
 from threading import Thread
 from time import sleep
 
@@ -145,7 +146,13 @@ def initWebsocket(self):
     #----------------------------------------------------------------------
     def readData(self, evt):
         """解码推送收到的数据"""
-        data = json.loads(evt)
+        # 先解压
+        decompress = zlib.decompressobj(-zlib.MAX_WBITS)
+        inflated = decompress.decompress(evt)
+        inflated += decompress.flush()
+        
+        # 再转换为json
+        data = json.loads(inflated)
         return data
 
     #----------------------------------------------------------------------
diff --git a/vnpy/trader/app/ctaStrategy/ctaEngine.py b/vnpy/trader/app/ctaStrategy/ctaEngine.py
--- a/vnpy/trader/app/ctaStrategy/ctaEngine.py
+++ b/vnpy/trader/app/ctaStrategy/ctaEngine.py
@@ -441,9 +441,9 @@ def initStrategy(self, name):
             strategy = self.strategyDict[name]
             
             if not strategy.inited:
-                self.callStrategyFunc(strategy, strategy.onInit)
                 strategy.inited = True
-                
+                self.callStrategyFunc(strategy, strategy.onInit)
+
                 self.loadSyncData(strategy)                             # 初始化完成后加载同步数据
                 self.subscribeMarketData(strategy)                      # 加载同步数据后再订阅行情
             else:
diff --git a/vnpy/trader/vtEngine.py b/vnpy/trader/vtEngine.py
--- a/vnpy/trader/vtEngine.py
+++ b/vnpy/trader/vtEngine.py
@@ -700,7 +700,7 @@ def addFileHandler(self, filename=''):
             if not filename:
                 filename = 'vt_' + datetime.now().strftime('%Y%m%d') + '.log'
             filepath = getTempPath(filename)
-            self.fileHandler = logging.FileHandler(filepath)
+            self.fileHandler = logging.FileHandler(filepath, mode='w', encoding='utf-8')
             self.fileHandler.setLevel(self.level)
             self.fileHandler.setFormatter(self.formatter)
             self.logger.addHandler(self.fileHandler)


Test patch:
Repository: vnpy/vnpy

Issue:
ubuntu　 ctp导入问题
## 环境

* 操作系统: Ubuntu 18.04
* Anaconda版本: Python 3.7 64位
* vn.py版本: DEV-2.0.1 branch 20190313（下载日期）

## Issue类型
三选一：Buｇ

## 预期程序行为
```
from vnpy.gateway.ctp import ctp_gateway导入成功
## 实际程序行为
'''from vnpy.gateway.ctp.ctp_gateway import CtpGateWay
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vnpy/vnpy/vnpy/gateway/ctp/__init__.py", line 1, in <module>
    from .ctp_gateway import CtpGateway
  File "/home/vnpy/vnpy/vnpy/gateway/ctp/ctp_gateway.py", line 6, in <module>
    from vnpy.api.ctp import (
  File "/home/vnpy/vnpy/vnpy/api/ctp/__init__.py", line 1, in <module>
    from .vnctpmd import MdApi
ModuleNotFoundError: No module named 'vnpy.api.ctp.vnctpmd'
```

## 重现步骤

```
删除setup下面的oes安装模块   
git clone -b v2.0.1-DEV https://github.com/vnpy/vnpy
cd vnpy
vim setup.py   #具体删除删除相关代码即可 
chmod +x install.sh  && ./install.sh   
# 安装会正常进行 
```

针对Bug类型Issue，请提供具体重现步骤以及报错截图




Discussion:
@nanoric 请帮忙看下
@nanoric  还是老样子 无法得到修复 。 请新建一个用户 + anaconda3 环境测试 

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -34,7 +34,7 @@
                     extra_compile_args=compiler_flags,
                     extra_link_args=extra_link_args,
                     depends=[],
-                    runtime_library_dirs=["vnpy/api/ctp"],
+                    runtime_library_dirs=["$ORIGIN"],
                     language="cpp",
                     )
 vnctptd = Extension("vnpy.api.ctp.vnctptd",
@@ -48,7 +48,7 @@
                     libraries=["thostmduserapi", "thosttraderapi", ],
                     extra_compile_args=compiler_flags,
                     extra_link_args=extra_link_args,
-                    runtime_library_dirs=["vnpy/api/ctp"],
+                    runtime_library_dirs=["$ORIGIN"],
                     depends=[],
                     language="cpp",
                     )


Test patch:
Repository: vnpy/vnpy

Issue:
已从期货公司获得“产品名称、授权编码”，但vnpy连接时一直提示“交易授权验证失败、CTP:客户端认证失败”
## 环境

* 操作系统: 如Windows 10或者Ubuntu 18.04
* Anaconda版本: 如Anaconda 18.12 Python 3.7 64位
* vn.py版本: 如v2.0发行版或者dev branch 20190101（下载日期）

## Issue类型
三选一：Bug

## 预期程序行为

## 实际程序行为

如题，本地配置没有问题，期货公司说他那边没有问题，我不确定到底是期货公司还是vnpy的连接问题，会不会是vnpy在验证CTP“产品名称、授权编码”时有bug？

vnpy版本：v2.0和v2.0.1-DEV都试过


## 重现步骤

针对Bug类型Issue，请提供具体重现步骤以及报错截图




Discussion:

Resolving patch:
diff --git a/vnpy/gateway/ctp/ctp_gateway.py b/vnpy/gateway/ctp/ctp_gateway.py
--- a/vnpy/gateway/ctp/ctp_gateway.py
+++ b/vnpy/gateway/ctp/ctp_gateway.py
@@ -405,7 +405,7 @@ def onRspAuthenticate(self, data: dict, error: dict, reqid: int, last: bool):
         """"""
         if not error['ErrorID']:
             self.authStatus = True
-            self.writeLog("交易授权验证成功")
+            self.gateway.write_log("交易授权验证成功")
             self.login()
         else:
             self.gateway.write_error("交易授权验证失败", error)
@@ -418,7 +418,7 @@ def onRspUserLogin(self, data: dict, error: dict, reqid: int, last: bool):
             self.login_status = True
             self.gateway.write_log("交易登录成功")
             
-            # Confirm settelment
+            # Confirm settlement
             req = {
                 "BrokerID": self.brokerid,
                 "InvestorID": self.userid
@@ -662,7 +662,7 @@ def authenticate(self):
             "UserID": self.userid,
             "BrokerID": self.brokerid,
             "AuthCode": self.auth_code,
-            "ProductInfo": self.product_info
+            "UserProductInfo": self.product_info
         }
         
         self.reqid += 1
@@ -678,7 +678,8 @@ def login(self):
         req = {
             "UserID": self.userid,
             "Password": self.password,
-            "BrokerID": self.brokerid
+            "BrokerID": self.brokerid,
+            "UserProductInfo": self.product_info
         }
         
         self.reqid += 1


Test patch:
Repository: vnpy/vnpy

Issue:
Bardata存储方式，造成数据库性能压力
## 环境

* 操作系统: Ubuntu 18.04
* Anaconda版本: Anaconda 5.2.0
* vn.py版本: v2.0.2
## Issue类型
三选一：Enhancement

## 预期程序行为
在数据很多的时候，不会因为表存储方式造成性能压力，希望对不同的合约品种，做分表处理。

## 实际程序行为
所有的合约品种都存储在一个 Table里面，当品种数量比较多的时候，时间跨度比较大的时候，整体的性能就会非常的差。

## 重现步骤
使用MySql数据库，全品种的主连合约分钟数据，有五千多万条，使用vnpy默认的 load_data.py 文件导入，数据全部存储在一个Table里面

![捕获](https://user-images.githubusercontent.com/2801450/57196584-dfaad780-6f90-11e9-9444-3c3ef0a2de24.PNG)




Discussion:
以后会考虑分表的，谢谢你的建议^_^
后续会增加对KDB数据库的支持，如果确实遇到性能瓶颈可以使用这个
已经提了一个pr，修复索引的问题，能解决这个瓶颈

Resolving patch:
diff --git a/vnpy/trader/database/database_mongo.py b/vnpy/trader/database/database_mongo.py
--- a/vnpy/trader/database/database_mongo.py
+++ b/vnpy/trader/database/database_mongo.py
@@ -55,7 +55,7 @@ class DbBarData(Document):
     meta = {
         "indexes": [
             {
-                "fields": ("datetime", "interval", "symbol", "exchange"),
+                "fields": ("symbol", "exchange", "interval", "datetime"),
                 "unique": True,
             }
         ]
@@ -150,7 +150,7 @@ class DbTickData(Document):
     meta = {
         "indexes": [
             {
-                "fields": ("datetime", "symbol", "exchange"),
+                "fields": ("symbol", "exchange", "datetime"),
                 "unique": True,
             }
         ],
diff --git a/vnpy/trader/database/database_sql.py b/vnpy/trader/database/database_sql.py
--- a/vnpy/trader/database/database_sql.py
+++ b/vnpy/trader/database/database_sql.py
@@ -82,7 +82,7 @@ class DbBarData(ModelBase):
 
         class Meta:
             database = db
-            indexes = ((("datetime", "interval", "symbol", "exchange"), True),)
+            indexes = ((("symbol", "exchange", "interval", "datetime"), True),)
 
         @staticmethod
         def from_bar(bar: BarData):
@@ -194,7 +194,7 @@ class DbTickData(ModelBase):
 
         class Meta:
             database = db
-            indexes = ((("datetime", "symbol", "exchange"), True),)
+            indexes = ((("symbol", "exchange", "datetime"), True),)
 
         @staticmethod
         def from_tick(tick: TickData):


Test patch:
Repository: vnpy/vnpy

Issue:
Bug：rqdata.py 中 RqdataClient 类的 to_rq_symbol 方法对连续和指数合约转换有问题
## 环境

* 操作系统: 如Windows 10
* Anaconda版本: Anaconda 18.12 Python 3.7 64位
* vn.py版本: v2.0.3

## Issue类型
三选一：Bug

## 预期程序行为
正确将合约名转换至rqdata中的合约名

## 实际程序行为
错误的将郑商所的合约连续和指数合约转换，例如将AP888会转换为AP2888，AP99会转换至AP199导致无法下载到数据。

## 重现步骤
在回测模块中下载AP88数据即可。

针对Bug类型Issue，请提供具体重现步骤以及报错截图





Discussion:

Resolving patch:
diff --git a/vnpy/trader/rqdata.py b/vnpy/trader/rqdata.py
--- a/vnpy/trader/rqdata.py
+++ b/vnpy/trader/rqdata.py
@@ -36,11 +36,15 @@ def __init__(self):
         self.inited = False
         self.symbols = set()
 
-    def init(self):
+    def init(self, username="", password=""):
         """"""
         if self.inited:
             return True
 
+        if username and password:
+            self.username = username
+            self.password = password
+
         if not self.username or not self.password:
             return False
 
@@ -75,6 +79,11 @@ def to_rq_symbol(self, symbol: str, exchange: Exchange):
                 if word.isdigit():
                     break
 
+            # Check for index symbol
+            time_str = symbol[count:]
+            if time_str in ["88", "888", "99"]:
+                return symbol
+
             # noinspection PyUnboundLocalVariable
             product = symbol[:count]
             year = symbol[count]
@@ -118,24 +127,27 @@ def query_history(self, req: HistoryRequest):
             frequency=rq_interval,
             fields=["open", "high", "low", "close", "volume"],
             start_date=start,
-            end_date=end
+            end_date=end,
+            adjust_type="none"
         )
 
         data: List[BarData] = []
-        for ix, row in df.iterrows():
-            bar = BarData(
-                symbol=symbol,
-                exchange=exchange,
-                interval=interval,
-                datetime=row.name.to_pydatetime() - adjustment,
-                open_price=row["open"],
-                high_price=row["high"],
-                low_price=row["low"],
-                close_price=row["close"],
-                volume=row["volume"],
-                gateway_name="RQ"
-            )
-            data.append(bar)
+
+        if df is not None:
+            for ix, row in df.iterrows():
+                bar = BarData(
+                    symbol=symbol,
+                    exchange=exchange,
+                    interval=interval,
+                    datetime=row.name.to_pydatetime() - adjustment,
+                    open_price=row["open"],
+                    high_price=row["high"],
+                    low_price=row["low"],
+                    close_price=row["close"],
+                    volume=row["volume"],
+                    gateway_name="RQ"
+                )
+                data.append(bar)
 
         return data
 


Test patch:
Repository: coala/coala-bears

Issue:
GitCommitBear: body_line_length shall be 72 and not 73
The standard git commit guidelines suggest wrapping the body at 72 chars. So just replace the default of 73 with 72.



Discussion:
Needed in `coala` too

unassigned due to having already fixed a newcomer issue :)

assign me 

all yours.


Resolving patch:
diff --git a/bears/vcs/git/GitCommitBear.py b/bears/vcs/git/GitCommitBear.py
--- a/bears/vcs/git/GitCommitBear.py
+++ b/bears/vcs/git/GitCommitBear.py
@@ -19,7 +19,7 @@ def check_prerequisites(cls):
 
     def run(self,
             shortlog_length: int=50,
-            body_line_length: int=73,
+            body_line_length: int=72,
             force_body: bool=False,
             allow_empty_commit_message: bool=False,
             shortlog_regex: str="",


Test patch:
diff --git a/tests/c_languages/codeclone_detection/ClangASTPrintBearTest.py b/tests/c_languages/codeclone_detection/ClangASTPrintBearTest.py
--- a/tests/c_languages/codeclone_detection/ClangASTPrintBearTest.py
+++ b/tests/c_languages/codeclone_detection/ClangASTPrintBearTest.py
@@ -52,6 +52,6 @@ def test_ast(self):
         ast = "\n"
         # Only check beginning of AST
         for i in range(expected_ast.count("\n")-1):
-            ast += self.queue.get(timeout=0).message + "\n"
+            ast += self.queue.get(timeout=0.1).message + "\n"
 
         self.assertEqual(ast, expected_ast)
diff --git a/tests/js/ESLintBearTest.py b/tests/js/ESLintBearTest.py
--- a/tests/js/ESLintBearTest.py
+++ b/tests/js/ESLintBearTest.py
@@ -36,4 +36,4 @@
 
 ESLintBearWithoutConfig = verify_local_bear(ESLintBear,
                                             valid_files=(test_good, test_bad),
-                                            invalid_files=(),)
+                                            invalid_files=())
diff --git a/tests/vcs/git/GitCommitBearTest.py b/tests/vcs/git/GitCommitBearTest.py
--- a/tests/vcs/git/GitCommitBearTest.py
+++ b/tests/vcs/git/GitCommitBearTest.py
@@ -170,7 +170,7 @@ def test_body_checks(self):
         self.git_commit(
             "Commits message with a body\n\n"
             "nearly exceeding the default length of a body, but not quite. "
-            "haaaaaaands")
+            "haaaaaands")
 
         self.assertEqual(self.run_uut(), [])
         self.assertTrue(self.msg_queue.empty())
Repository: coala/coala-bears

Issue:
YapfBear: Make asciinema 
@Mariatta  are you interested? 



Discussion:
yes please :+1: 


Resolving patch:
diff --git a/bears/python/YapfBear.py b/bears/python/YapfBear.py
--- a/bears/python/YapfBear.py
+++ b/bears/python/YapfBear.py
@@ -23,6 +23,7 @@ class YapfBear(LocalBear):
     AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}
     LICENSE = 'AGPL-3.0'
     CAN_FIX = {'Formatting'}
+    ASCIINEMA_URL = 'https://asciinema.org/a/89021'
 
     @deprecate_settings(indent_size='tab_width')
     def run(self, filename, file,


Test patch:
Repository: coala/coala-bears

Issue:
CheckstyleBear should error when use_spaces is False or indent_size is not 2
If `checkstyle_configs = Google`, indentation checking using 2 spaces, according to https://google.github.io/styleguide/javaguide.html#s4.2-block-indentation

`use_spaces=False` must emit an error
`indent_size` must be set to 2, otherwise emit an error.



Discussion:
@jayvdb shouldn't we rather use like "google" as base and then modify according to the given settings?


Resolving patch:
diff --git a/bears/java/CheckstyleBear.py b/bears/java/CheckstyleBear.py
--- a/bears/java/CheckstyleBear.py
+++ b/bears/java/CheckstyleBear.py
@@ -10,6 +10,13 @@
     "geosoft": "http://geosoft.no/development/geosoft_checks.xml"}
 
 
+def check_invalid_configuration(checkstyle_configs, use_spaces, indent_size):
+    if (checkstyle_configs is 'google' and
+            (not use_spaces or indent_size != 2)):
+        raise ValueError('Google checkstyle config does not support '
+                         'use_spaces=False or indent_size != 2')
+
+
 def known_checkstyle_or_path(setting):
     if str(setting) in known_checkstyles.keys():
         return str(setting)
@@ -44,7 +51,8 @@ def setup_dependencies(self):
 
     def create_arguments(
             self, filename, file, config_file,
-            checkstyle_configs: known_checkstyle_or_path="google"):
+            checkstyle_configs: known_checkstyle_or_path="google",
+            use_spaces: bool=True, indent_size: int=2):
         """
         :param checkstyle_configs:
             A file containing configs to use in ``checkstyle``. It can also
@@ -64,6 +72,9 @@ def create_arguments(
             - geosoft - The Java style followed by GeoSoft. More info at
               <http://geosoft.no/development/javastyle.html>
         """
+        check_invalid_configuration(
+            checkstyle_configs, use_spaces, indent_size)
+
         if checkstyle_configs in known_checkstyles:
             checkstyle_configs = self.download_cached_file(
                 known_checkstyles[checkstyle_configs],


Test patch:
diff --git a/tests/java/CheckstyleBearTest.py b/tests/java/CheckstyleBearTest.py
--- a/tests/java/CheckstyleBearTest.py
+++ b/tests/java/CheckstyleBearTest.py
@@ -30,6 +30,18 @@ def test_known_configs(self):
         self.section["checkstyle_configs"] = "google"
         self.check_validity(self.uut, [], self.good_file)
 
+    def test_config_failure_use_spaces(self):
+        self.section["checkstyle_configs"] = "google"
+        self.section.append(Setting('use_spaces', False))
+        with self.assertRaises(AssertionError):
+            self.check_validity(self.uut, [], self.good_file)
+
+    def test_config_failure_indent_size(self):
+        self.section["checkstyle_configs"] = "google"
+        self.section.append(Setting('indent_size', 3))
+        with self.assertRaises(AssertionError):
+            self.check_validity(self.uut, [], self.good_file)
+
     def test_with_custom_configfile(self):
         self.section["checkstyle_configs"] = self.empty_config
         self.check_validity(self.uut, [], self.good_file)
Repository: coala/coala-bears

Issue:
GitCommitBear: Change ``returns`` to ``return``
[line](https://github.com/coala-analyzer/coala-bears/blob/master/bears/vcs/git/GitCommitBear.py#L147)
difficulty/newcomer



Discussion:
Thanks for reporting this issue!

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

CC @sils1297, @AbdealiJK

Haha! The Irony!

yeah this is really funny :)

I want to do this

unassigning due to PR inactivity

unassigning due to long inactivity

@Adrianzatreanu please assign this to me :)


Resolving patch:
diff --git a/bears/vcs/git/GitCommitBear.py b/bears/vcs/git/GitCommitBear.py
--- a/bears/vcs/git/GitCommitBear.py
+++ b/bears/vcs/git/GitCommitBear.py
@@ -148,7 +148,7 @@ def check_imperative(self, paragraph):
 
         :param paragraph:
             The input paragraph to be tested.
-        :returns:
+        :return:
             A list of tuples having 2 elements (invalid word, parts of speech)
             or an empty list if no invalid words are found.
         """


Test patch: