Project

General

Profile

Actions

action #92665

closed

Automatically validate code style for python code

Added by osukup almost 3 years ago. Updated almost 3 years 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:

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 1 (1 open0 closed)

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

Actions
Actions #1

Updated by okurz almost 3 years 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.

Actions #2

Updated by okurz almost 3 years 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?

Actions #4

Updated by livdywan almost 3 years 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.

Actions #5

Updated by osukup almost 3 years 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

Actions #6

Updated by livdywan almost 3 years ago

  • Status changed from In Progress to Feedback

The last open PR was merged, all done?

Actions #7

Updated by livdywan almost 3 years ago

  • Due date changed from 2021-06-02 to 2021-06-08
Actions #8

Updated by livdywan almost 3 years 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.

Actions #10

Updated by osukup almost 3 years 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

Actions #11

Updated by livdywan almost 3 years 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
Actions #13

Updated by osukup almost 3 years ago

  • Status changed from Feedback to Resolved
Actions #14

Updated by tinita almost 3 years ago

  • Related to action #93892: [beginner][easy] Automatically validate code style for python code in openQA added
Actions

Also available in: Atom PDF