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

Makefile: 'make flake8' tests the entire codebase #879

Merged
merged 4 commits into from
Aug 31, 2018

Conversation

cclauss
Copy link

@cclauss cclauss commented Aug 30, 2018

It is safer and just as fast to have flake8 test the entire codebase.

I do not know of a safe way to fix the remaining undefined name pkgdir:
https://github.com/git-cola/git-cola/blob/master/contrib/win32/pynsist-preamble.py#L9

@davvid
Copy link
Member

davvid commented Aug 31, 2018

Good idea. For the pynsist-preamble.py you can split the expression up into multiple lines and then on the lines that fail append # noqa to the end of the lines and flake8 should skip them.

Those are variables provided by the pynsist installer framework, so they're invisible.

davvid added a commit to davvid/git-cola that referenced this pull request Aug 31, 2018
* cclauss/patch-1:
  Fix whitespace in extras/__init__.py to placate flake8
  Fix multiple imports on one line in share/doc/git-cola/conf.py
  $(FLAKE8) $(FLAKE8_FLAGS) --exclude=./qtpy .
  Makefile: 'make flake8' tests the entire codebase

Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this pull request Aug 31, 2018
Closes git-cola#882
Related-to: git-cola#879
Reported-by: @cclauss
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this pull request Aug 31, 2018
The user might have virtualenvs and/or python installations (via
contrib/build-git-cola.sh) in their worktree, so invoking flake8 with
'.' is too wide a net and can be very slow.

We expect virtualenvs and tox environments to exist, per the
.gitignore rules, but the flake8 invocation would pick them up.

It's also unclear whether the `--exclude` flag replaces, or
augments the built-in exclusion list.  From the looks of it, the
flag full-on replaces the built-in patterns, which means that we
would also need to list `.git`, `__pycache__`, and other
possible directories in the exclusion list.

Maintaining an exclusion list in a world of virtualenvs is more
effort than using $(ALL_PYTHON_DIRS) in the target.

In light of this, it's better to be consistent with the rest of
the Makefile targets.  Use $(ALL_PYTHON_DIRS) and add
`contrib/win32` to the list of checked python directories so
that the pynsist preamble is picked up by pylint and flake8.

Related-to: git-cola#879
Reverts: af26369
Signed-off-by: David Aguilar <davvid@gmail.com>
@davvid davvid merged commit f47e05b into git-cola:master Aug 31, 2018
@davvid
Copy link
Member

davvid commented Aug 31, 2018

Merged, but I ended up reverting the part the makes it use . in the flake8 invocation. See d029ab2 for details.

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

Successfully merging this pull request may close these issues.

None yet

2 participants