Refactor_202031990423_qianjunqi #94
Open
qianjunqi
wants to merge 1 commits from
Refactor_qianjunqi
into master
pull from: Refactor_qianjunqi
merge into: mrlan:master
mrlan:Alpha-snapshot20240618
mrlan:Bug580-Hui
mrlan:Bug565-Hui
mrlan:Bug394-Hui
mrlan:Bug478-Hui
mrlan:Bug501-Hui
mrlan:Bug511-Hui
mrlan:Bug518-Hui
mrlan:Bug563-Hui
mrlan:bug555-fangchen
mrlan:Bug547-FanWenQi-Adapted
mrlan:SPM2023S-QianJunQi
mrlan:Bug536-Jiangwangzhe
mrlan:Bug540-XiongJiaming
mrlan:Bug579-LuKangyang
mrlan:BUG543-JiWenkai
mrlan:Bug574-ChenLingjie2
mrlan:Bug573-PanBinjie
mrlan:Bug570_CaiShuHuang
mrlan:Bug578-ChenChen2
mrlan:Bug578-ChenChen
mrlan:Bug577-JiangXueQin
mrlan:Bug576-XiaBaizhi
mrlan:Bug564-JiangChao
mrlan:Bug572-ZhongYi2
mrlan:Bug533-ZhangXuDong
mrlan:Bug392-LiJie
mrlan:Bug358-LiJie
mrlan:Bug534-WangWeitao
mrlan:Bug569-YuTianshuai
mrlan:Bug563-HuangHaoqi
mrlan:Bug571-TongQi
mrlan:Bug572-ZhongYi
mrlan:Bug566-SunJiawen
mrlan:Bug574-ChenLingjie
mrlan:Bug565-ChenYuhang
mrlan:Bug568-SongHaiyan
mrlan:Bug567-YuZheChen
mrlan:Bug571-TonQi
mrlan:Bug561-LiangZiyue
mrlan:Bug511-Bosh
mrlan:Bug555-chenshiying
mrlan:Bug513-Mayada
mrlan:Bug543-AyaOK
mrlan:Bug518-Mponeja
mrlan:Bug543-Aya
mrlan:Bug547_FanWenQi
mrlan:bug-497Gongzhengcheng
mrlan:Bug500-Badr
mrlan:Bug518-Esther
mrlan:Bug536-QianLetao
mrlan:Alpha-snapshot20230621
mrlan:Bug533-Yuyikai
mrlan:Bug562-Wuyichen
mrlan:Alpha-snapshot20230621OK
mrlan:Bug476-LiMengdie
mrlan:Bug545-HuangHuiLing
mrlan:Bug561-WanZiKun
mrlan:BugTBD-LiSinan
mrlan:master
mrlan:Bug579
mrlan:0618、
mrlan:Bug551-DingZeYu
mrlan:547
mrlan:542
mrlan:Bug528-TangJiao
mrlan:Bug553_LinShan
mrlan:Bug-561
mrlan:fix-vuln
mrlan:Bug476-Yuhuangtao
mrlan:Bug527-ZhouZhifang
mrlan:Alpha-snapshot20230615
mrlan:Bug473-Buya
mrlan:Bug534-NingShushuang
mrlan:improvment_GuHan
mrlan:Bug393-TanYanMei
mrlan:improvment-NiWeiCong2
mrlan:refactor-huangzirui
mrlan:Bosh
mrlan:Alpha-snapshot20230605
mrlan:refactor-wangyu
mrlan:Alpha-snapshot20230601
mrlan:Alpha-snapshot20230531
mrlan:Bug529-GuHan
mrlan:Bug492-XuHongJian-HuangZirui
mrlan:Alpha-snapshot20230529
mrlan:Bug522-HuangZirui
mrlan:Refactor-XunYucan
mrlan:Alpha-snapshot20230525
mrlan:Refactor-HeZhengzheng
mrlan:Alpha-snapshot20230511
mrlan:Bug407-JinHaoLin
mrlan:Alpha-snapshot20230519
mrlan:Bug476-YuHuangtao
mrlan:Bug476-ZhangWeiHao-YuHuangtao
mrlan:Bug473-LuXiaochen
mrlan:Bug493-GongKeCheng
mrlan:Bug488-TangWei
mrlan:SOFTARCH2023S-ZENOVIO
mrlan:Bug532-HuangDan
mrlan:Bug476-ZhangWeiHao-BaoYuelin
mrlan:Bug504-LiJia
mrlan:SPM2023-PR44-YuGaoxiang
mrlan:Bug476-ZhangWeiHao
mrlan:Alpha-snapshot20230507
mrlan:Huangdan
mrlan:Bug509-XieQiuHan-WangZiming-HuangDan
mrlan:Alpha-snapshot20230506
mrlan:improvment-NiWeiCong
mrlan:Bug502-YuGaoXiang
mrlan:bug359-zhangkeli
mrlan:593
mrlan:Alpha-snapshot20230427
mrlan:Alpha-snapshot20230425
mrlan:Bug509-XieQiuHan-WangZiming
mrlan:Alpha-snapshot20230426
mrlan:Alpha
mrlan:Lanhui-update-README2
mrlan:SPM2022F-CONTRIBUTORS-WuWenZhuo
mrlan:Bug490-ChenQiuwei
mrlan:Bug525-Hui
mrlan:englishpal
mrlan:AAALF
mrlan:Bug509-XieQiuHan
mrlan:SPM2022F-CONTRIBUTORS-DingRui
mrlan:SPM2022F-CONTRIBUTORS-jiaojiao
mrlan:Bug521-LiYuFeng-refactor
mrlan:Bug492-XuHongJian
mrlan:SPM2022F-CONTRIBUTORS-XIEQIUHAN
mrlan:SPM2022F-CONTRIBUTORS-XuHongJian
mrlan:509
mrlan:Bug512-RenYu
mrlan:SPM2022F-CONTRIBUTORS-GONGKE
mrlan:Bug521-LiYuFeng
mrlan:SPM2022F-CONTRBUTORS-luofei
mrlan:SPM2022F-CONTRIBUTORS-RUANYUXUAN
mrlan:bug492
mrlan:SPM2022F-CONTRIBUTORS-LINJUNHONG
mrlan:SPM2022F-CONTRIBUTORS-TANGWEI
mrlan:Bug508-CenHaotian
mrlan:SPM2022F-CONTRIBUTORS-GONGKECHENG
mrlan:Bug499-Hui
mrlan:SPM2022F-CONTROIBUTORS-XUHONGJIAN
mrlan:SPM2022F-CONTRBUTORS-TECHLEADNAME
mrlan:Bug505-ZhangYiteng
mrlan:Bug495-LiangLiGang
mrlan:SPM2022F-CONTRIBUTORS-LIJIA
mrlan:SPM2022F-CONTRIBUTORS-CENHAOTIAN
mrlan:SPM2022F-CONTRIBUTORS-ChenQiuwei
mrlan:Bug499-WangZiming
mrlan:Bug487-WuYuhan-Refactor
mrlan:Hui-Build
mrlan:Bug487-WuYuhan
mrlan:Bug412-JiangLetian-Refactor
mrlan:Bug412-JiangLetian
mrlan:Hui-EscapeUserInput
mrlan:Bug422-XuXing
mrlan:Improvement-Stewart
mrlan:Bug400-QiuZhonghui-Refactor
mrlan:Bug477-ChenJingyi
mrlan:Bug400-QiuZhonghui
mrlan:Bug474-RenYinJie
mrlan:Bug344-JiangXueHong
mrlan:Bug428-LouJiCheng
mrlan:SOFTARCH2022S-ZAYID-478
mrlan:Bug392-LuoYu
mrlan:Bug358-TengJiaQian
mrlan:Bug410-DuanJiaJie
mrlan:Bug209-LiuChangYou
mrlan:Bug393-QinYanMei
mrlan:IMPROVE-WangWeiLong
mrlan:Bug391-LiuYiXiu
mrlan:Bug260-Mohanad
mrlan:bug209_yaaqobv2
mrlan:BugFix407-JinHaoLin
mrlan:Bug394-MiaoChenShuo
mrlan:bug209-yaaqob
mrlan:Bug257-MaJiaBin
mrlan:Bug395-Anxiuxiu
mrlan:Deployment
mrlan:ChenTianle-TypoCorrection
mrlan:Hui-SaferSQL
mrlan:BugFix347
mrlan:WangXuan-Highlight-Pronounce
mrlan:Lanhui-Selenium
mrlan:Lanhui-update-README
mrlan:BugFix300
mrlan:Lanhui-IncreaseChanceOfGettingDifficultArticles
mrlan:BugFix293
mrlan:BugFix284
mrlan:Lanhui-flash-messages
mrlan:Lanhui-go-bootstrap
mrlan:Lanhui-build.sh
mrlan:BugFix254-Author-ZhanJianhao
mrlan:Lanhui-add-articles
1 Commits (master)
Author | SHA1 | Message | Date |
---|---|---|---|
钱骏琪 | ea16ea6673 |
Pylint部分:
1. 补充module docstring,即文档顶部的简要说明 (我做的说明很简陋,只是为了通过pylint的检查而为之) 2. 优化了if-else-return,即删除了不必要的elif或else 3. 拆分了所有在同一行的模块引用(不同模块的引用需要放在不同行,以便理解和阅读) 4. 删除了部分没有被使用的引用(有的引用在文件A中被使用了,但import却写在了文件B,且文件B没有使用这些引用,而文件A引用了文件B,导致文件B的所有引用也被A引用,这似乎并不合理) 5. 修改了引用的顺序(os、random等系统引用应放在自定义模块引用的上方) 6. 修改了过长的代码,注释除外(每行限制在100个字符以内) 7. 优化了条件判断的判断符号: is和is not 用于判断两个变量是否指向同一个位置 == 和 !=用于比较两个变量 8. 为每个py文件添加了"last new line",删除了多余的尾部空行 Pylint提示了但是没有进行的操作: 1. 将字符串改为f-string的格式 因为f-string需要python3.6以上的版本,为了防止出现版本问题,故不做修改 2. 将所有函数内的return内容改为一致的类型 因为原有的代码逻辑已经确定,修改return的类型会导致方法的无法使用,故不做修改 3. 将标识符的格式改为"snake_case naming style" 标识符的修改内容过于庞大,且可能出现程序不可预见的错误,在pylint中重要等级为0,故不做修改 JSLint Part: 1. 提高代码的可读性:将部分超过80个字符的代码行拆解开(由于文字注释的存在,很多语句仅注释就超过了80个字符,此类型的语句行不做修改) 2. 用===与!==代替==与!=的判断 3. 将i++改为i+=1 4. 分离for循环中的let与var到其他行中,以适应JSLint在循环语句中对var和let的偏好 5. 给三元表达式外围添加圆括号,避免出现优先级的问题 6. 将正则表达式修改为JSLint要求的多行模式 疑问: 形如: for (let i = 0; i < list.length; i+=1) { 的语句,JSLint报错: [JSLint was unable to finish] Unexpected 'let'. 但是网上搜索到的结果是ES6是支持let的使用的,暂且不做修改。 |