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

flake8 issues to fix #23

Closed
cclauss opened this issue Jun 27, 2018 · 11 comments
Closed

flake8 issues to fix #23

cclauss opened this issue Jun 27, 2018 · 11 comments

Comments

@cclauss
Copy link
Contributor

cclauss commented Jun 27, 2018

flake8 testing of https://github.com/apachecn/LeetCode on Python 3.6.3

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./docs/Leetcode_Solutions/Summarization/python_base.py:6:4: E999 IndentationError: unexpected indent
    dir(obj)            # 简单的列出对象obj所包含的方法名称,返回一个字符串列表
   ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:14:11: F821 undefined name 'matrix'
row = len(matrix)
          ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:15:11: F821 undefined name 'matrix'
col = len(matrix[0]) if row else 0
          ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:38:4: F821 undefined name 'key'
if key in D:
   ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:39:5: F821 undefined name 'key'
  D[key].append(1)
    ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:41:5: F821 undefined name 'key'
  D[key] = []
    ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:45:1: F821 undefined name 'string'
string[::-1]
^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:47:10: F821 undefined name 'string'
"".join([string].reverse())
         ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:56:16: F821 undefined name 'heap'
heapq.heappush(heap, item) # 把item添加到heap中(heap是一个列表)
               ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:56:22: F821 undefined name 'item'
heapq.heappush(heap, item) # 把item添加到heap中(heap是一个列表)
                     ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:58:15: F821 undefined name 'heap'
heapq.heappop(heap) # 把堆顶元素弹出,返回的就是堆顶
              ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:60:19: F821 undefined name 'heap'
heapq.heappushpop(heap, item) # 先把item加入到堆中,然后再pop,比heappush()再heappop()要快得多
                  ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:60:25: F821 undefined name 'item'
heapq.heappushpop(heap, item) # 先把item加入到堆中,然后再pop,比heappush()再heappop()要快得多
                        ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:62:19: F821 undefined name 'heap'
heapq.heapreplace(heap, item) # 先pop,然后再把item加入到堆中,比heappop()再heappush()要快得多
                  ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:62:25: F821 undefined name 'item'
heapq.heapreplace(heap, item) # 先pop,然后再把item加入到堆中,比heappop()再heappush()要快得多
                        ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:64:15: F821 undefined name 'x'
heapq.heapify(x) # 将列表x进行堆调整,默认的是小顶堆
              ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:66:14: F821 undefined name 'iterables'
heapq.merge(*iterables) # 将多个列表合并,并进行堆调整,返回的是合并后的列表的迭代器
             ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:68:16: F821 undefined name 'n'
heapq.nlargest(n, iterable, key=None) # 返回最大的n个元素(Top-K问题)
               ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:68:19: F821 undefined name 'iterable'
heapq.nlargest(n, iterable, key=None) # 返回最大的n个元素(Top-K问题)
                  ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:70:17: F821 undefined name 'n'
heapq.nsmallest(n, iterable, key=None) # 返回最小的n个元素(Top-K问题)
                ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:70:20: F821 undefined name 'iterable'
heapq.nsmallest(n, iterable, key=None) # 返回最小的n个元素(Top-K问题)
                   ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:98:16: F821 undefined name 'n'
for i in range(n):
               ^
./docs/Leetcode_Solutions/Summarization/Python刷题技巧笔记.py:100:3: F821 undefined name 'a'
  a[~i] = 1
  ^
1     E999 IndentationError: unexpected indent
22    F821 undefined name 'matrix'
23
@0xkookoo
Copy link
Contributor

This file is used to show newbies all the api or methods of python data types, and it doesn't mean it can run flawlessly.

@cclauss
Copy link
Contributor Author

cclauss commented Jun 27, 2018

A Python file (ends in .py) that contains syntax errors will not help newbies.

@0xkookoo
Copy link
Contributor

That should be .md format file, I didn't convert it.

@jiangzhonglian
Copy link
Member

是不是应该说中文,效率更高一点? 😄😄

@cclauss
Copy link
Contributor Author

cclauss commented Jun 28, 2018

Yes. ;-)

@0xkookoo
Copy link
Contributor

So this issue shall be closed.

@cclauss
Copy link
Contributor Author

cclauss commented Jun 28, 2018

不,这些是真正的问题。 这些问题不是关于中文或英文,而是关于Python的。

@0xkookoo
Copy link
Contributor

麻烦你转一下格式,内容不用怎么改,就当成一个函数查询文档吧,然后提个PR,谢谢🙏

@cclauss
Copy link
Contributor Author

cclauss commented Jun 28, 2018

持续集成将允许我们在合并前对所有请求进行测试。 ApacheCN项目是否使用任何自动化测试系统,如Travis CICircle CIAppVeyor

@0xkookoo
Copy link
Contributor

@jiangzhonglian 问问片刻,项目发版组织等都由片刻负责。

@jiangzhonglian
Copy link
Member

@cclauss 没有

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants