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

Add Bazel Linter to the project #1736

Closed
10 tasks
Tracked by #3610
anandwana001 opened this issue Aug 28, 2020 · 1 comment · Fixed by #2048
Closed
10 tasks
Tracked by #3610

Add Bazel Linter to the project #1736

anandwana001 opened this issue Aug 28, 2020 · 1 comment · Fixed by #2048
Assignees
Labels
Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@anandwana001
Copy link
Contributor

anandwana001 commented Aug 28, 2020

With the Bazel migration, we are now having BUILD and .bzl files in our codebase. We would like to add a linter that ensures all the Bazel files follow the same style.

We are looking forward to options like Skylint.
Skylint is not much recommended by officials, so we have another option to use Buildifier and it's Linter

Buildifier can be easily set up within the codebase. Link

Reference

- run: buildifier -mode=diff $(find . -iname BUILD.bazel -type f)

We have to fix this in parts

  • Root files (BUILD.bazel WORKSPACE oppia_android_test.bzl)
  • app module
  • data module
  • domain module
  • model module
  • testing module
  • utility module

For this, we might have to do some additional stuff on WORKSPACE as well as BUILD file.

  • Run the linter on our existing Bazel files. Create a PR that fixes all lint problems that the linter catches

  • Add steps in the linter job of our GitHub Action workflow (similar to the Kotlin linting step) that will install and run the linter on our Bazel files

  • Add documentation on how to install the linter in the prerequisites section of our wiki

@anandwana001
Copy link
Contributor Author

Removing myself as assignee for this issue for this week for two points:

  1. After package renaming most of the things get fixed already.
  2. We need to have pre-commit hooks before adding new linters

@anandwana001 anandwana001 self-assigned this Nov 19, 2020
anandwana001 added a commit that referenced this issue Feb 13, 2021
* bazel lint fix

* bazel lint fix

* rules_android

* app package visibility modify

* exporting app manifest file

* target path fix

* nit formatting

* nit change

* nit fix

* updating visiblity

* updating visiblity

* shifting crashlytics and removing from app module

* nit fix

* nit fix

* update linter command

* adding pre push

* using script in github workflow

* revert

* undo change

* nit fix

* adding scripts

* putting buildifier error

* fixing buildifier error
@BenHenning BenHenning added the Z-ibt Temporary label for Ben to keep track of issues he's triaged. label Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-ibt Temporary label for Ben to keep track of issues he's triaged.
Projects
None yet
2 participants