securefederatedai/openfl

Flake8 Linting Issues Not Detected in check code format (Pull Request) Workflow

Closed this issue · 2 comments

Describe the bug
Discrepancy in Flake8 linting results between workflows triggered on pull requests(check code format) workflow and workflows triggered on daily basis (Ubuntu (latest) workflow).

Expected Behavior:

Flake8 linting issues should be detected and reported in the pull request workflow, avoiding linting mistakes while committing to the development branch.

Actual Behavior:

Flake8 linting issues are detected only after the PR is merged. When a PR is raised, no Flake8 issues are shown, even if the code contains linting issues.
This issue is causing daily workflow to fail i.e Ubuntu (latest) workflow.

To Reproduce
Steps to reproduce the behavior:

  1. Create a New Pull Request with code changes that intentionally introduce Flake8 linting issues (e.g., extra whitespace, undefined variables).
  2. Observe the Pull Request (check code format) Workflow Execution:
  3. The Check code format workflow runs but does not detect the introduced Flake8 linting issues.
  4. Merge the PR into the develop branch.
  5. Observe the daily(Ubuntu (latest)) Workflow Execution:
  6. Flake8 linting issues are deteceted.

Expected behavior
The Flake8 linting issues should be detected and reported in the pull request workflow to prevent the merge of code with formatting issues.

Environment:
OS: Ubuntu (latest)

Screenshots
check code format Workflow
Screenshot 2024-11-06 at 11 09 49 AM

Ubuntu (latest) workflow
Screenshot 2024-11-06 at 11 10 23 AM

@rajithkrishnegowda We run formatter and linter checks in CI using ./shell/lint.sh, which internally uses flake8 configuration from setup.cfg. The discrepancy appears here because it does not know what warnings to ignore from the lack of a config file. Regardless, I recommend flake8-related checks be removed from all other CI tests, since we do it once during PR anyway.

Issue was fixed in #1130