Project

General

Profile

action #92665

Automatically validate code style for python code

Added by osukup 2 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Feature requests
Target version:
Start date:
2021-05-13
Due date:
2021-06-09
% Done:

0%

Estimated time:
Difficulty:

Description

Motivation

It would be great to have automated checks for more style aspects to python code

We use perl-Tidy and perl-Critic for perl code and strictly checks in CI, it will be nice to have same
standard also for other languages.

Acceptance criteria

  • AC1: python code style is checked automatically

Acceptance tests

  • AT1: Inconsistent codestyle prevents deployments

Suggestion

  • use black for python code style

Related issues

Related to openQA Project - action #93892: Automatically validate code style for python code in openQAWorkable2021-06-11

History

#1 Updated by okurz 2 months ago

  • Due date set to 2021-05-28
  • Category set to Feature requests
  • Status changed from New to In Progress
  • Assignee set to osukup
  • Priority changed from Normal to Low
  • Target version set to Ready

I agree. Let's go with https://github.com/os-autoinst/openqa_review/pull/142 in openqa-review first and then let's try to add the according checks to other projects where we use python as well.

#2 Updated by okurz 2 months ago

https://github.com/os-autoinst/openqa_review/pull/142 replaced by https://github.com/os-autoinst/openqa_review/pull/143 which got merged. https://travis-ci.org/github/os-autoinst/openqa_review/jobs/771437422#L211 shows a passed black check run within the openqa-review tests.

osukup would you like to give it a try to bring in equivalent checks for other repos, e.g. os-autoinst and/or openQA?

#4 Updated by cdywan about 2 months ago

  • Due date changed from 2021-05-28 to 2021-06-02

osukup wrote:

https://github.com/os-autoinst/openqa-trigger-from-obs/pull/131
and
https://github.com/os-autoinst/os-autoinst/pull/1679

https://github.com/os-autoinst/os-autoinst/pull/1679 is still open. osukup please sort out remaining questions if any and ensure the PR is mergeable. I'm bumping the Due date to tomorrow in the meantime.

#5 Updated by osukup about 2 months ago

cdywan wrote:

https://github.com/os-autoinst/os-autoinst/pull/1679 is still open. osukup please sort out remaining questions if any and ensure the PR is mergeable. I'm bumping the Due date to tomorrow in the meantime.

is merged ....

new PR https://github.com/os-autoinst/openqa_bugfetcher/pull/4

#6 Updated by cdywan about 2 months ago

  • Status changed from In Progress to Feedback

The last open PR was merged, all done?

#7 Updated by cdywan about 2 months ago

  • Due date changed from 2021-06-02 to 2021-06-08

#8 Updated by cdywan about 2 months ago

  • Due date changed from 2021-06-08 to 2021-06-09

So apparently a due date of "today" is pointless in terms of getting it off the list for the day.

#10 Updated by osukup about 2 months ago

  • Status changed from Feedback to Resolved

okurz wrote:

https://github.com/os-autoinst/openqa_bugfetcher/runs/2763136167?check_suite_focus=true says "No"

y, code quality of bugfetcher isn't best :D and pytlint complaints a lot

but from the perspective of this ticket --> automatic check for style with black is completed in all os-autoinst project's

#11 Updated by cdywan about 2 months ago

  • Status changed from Resolved to Feedback

osukup wrote:

y, code quality of bugfetcher isn't best :D and pytlint complaints a lot

The ticket is not about black or pylint. AT1: Inconsistent codestyle prevents deployments is not fulfilled as far as I can see. So I see 3 obvious options here:

  • Drop pylint
  • Fix pylint
  • File a ticket about why fixing pylint is non-trivial

#13 Updated by osukup about 2 months ago

  • Status changed from Feedback to Resolved

#14 Updated by tinita about 1 month ago

  • Related to action #93892: Automatically validate code style for python code in openQA added

Also available in: Atom PDF