question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting up a wemake-python-styleguide GitHub action that respects a legacy code flakehell baseline

See original GitHub issue

Dear wemake-python-styleguide team,

first of all, thanks for the greatest of all python linters! m(__)m

This is not Bug Report, but I have a wemake-python-styleguide specific question, that seems to require an answer by the people who actually know best about the wemake-python-styleguide - and that is obviously you.

So forgive me for misusing the Bug Report to pose my question here.

I posted the very same question on StackOverflow, but it feels like it doesn’tt reach the right audience there to get a proper answer.


Problem

I want to to set up a GitHub Action that runs the wemake-python-styleguide on every push to the repo, but respects a legacy code flakehell baseline.

According to the wemake-python-styleguide Website, “flakehell is officially supported by wemake-python-styleguide and developed by the same people”.

My problem is: All the GitHub Action workflow file (.yml) specifications I’ve tried so far, did not work.

Setup

First, I set a flakehellbaseline locally via flakehell > .flakehellbaseline and put the

[tool.flakehell]
baseline = ".flakehell_baseline"

in my pyproject.toml. Pushed everything to the repo.

Github action workflow specification

1.) Attempt

Then I created a new GitHub Action workflow file (wemakepython.yml) according to their premade Github Action.

name: wemakepython

on: push

jobs:
  wemake:
      runs-on: ubuntu-18.04
      steps:
        - name: wemake-python-styleguide
          uses: wemake-services/wemake-python-styleguide@0.14.0

Result:

enter image description here

The action gets triggered, and runs through smoothly. But, it does not report any flake8 or flakehell lint violations, despite there being plenty of them. How do I know that? If I run either flakehell lint or flake8 . locally, there are plenty of violations.

2.) Attempt

If the wemake-python-styleguide premade GitHub Action does not work, I’ll just specify a flakehell.yml GitHub Action by myself.

name: flakehell

on: push

jobs:
  build:
    runs-on: ubuntu-18.04
    steps:
      - name: flakehell-linter
        run: |
          pip install flakehell
          flakehell lint

Result:

Unfortunately this one doesn’t work either. The action does not even run, it exits with error code 1.

@github-actions
github-actions
/ build

.github#L1
Process completed with exit code 1.

Any ideas how to solve this? May it be a problem with the setup.cfg and pyproject.toml definitions?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
sobolevncommented, Apr 2, 2020

I hope to get this done by the end of this week. 👍

1reaction
chamaoskurumicommented, Jun 10, 2020

Hey @sobolevn, any chance the --baseline feature gets a review and makes it into a release anytime soon? 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting up a wemake-python-styleguide GitHub action that ...
I want to to set up a GitHub Action that runs the wemake-python-styleguide on every push to the repo, but respects a legacy...
Read more >
Setting Up A Wemake-Python-Styleguide Github ... - ADocLib
set up wemakepythonstyleguide GitHub Actions workflow that checks if your code is aligned ... GitHub action that respects a legacy code flakehell baseline....
Read more >
baseline: integrate into a huge project - FlakeHell
Baseline allows you to remember the current project state and then show only new errors, ignoring old ones. First of all, let's create...
Read more >
wemake-python-styleguide Changelog - pyup.io
Updates GitHub Action's base Python image version to `3.8.8` Features ... Documents how to use `flakehell` to create `baseline`s for legacy integrations
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found