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

Allows check/lint individual files with bazel run //tools/lint:check -- clang -- file.cc #837

Merged
merged 3 commits into from
Mar 5, 2020

Conversation

yongtang
Copy link
Member

@yongtang yongtang commented Mar 5, 2020

This PR update out lint tool so that it is possible to run:
bazel run //tools/lint:check -- clang -- file.cc

to check specific file.cc, and run:

bazel run //tools/lint:lint -- clang -- file.cc

to reformat specific file.cc.

In addition, this PR also adds support for black so that

bazel run //tools/lint:lint -- black -- tensorflow_io/python/core/ops/version_ops.py (for lint)

bazel run //tools/lint:check -- black -- tensorflow_io/python/core/ops/version_ops.py (for check)

could be used similiarly.

Signed-off-by: Yong Tang yong.tang.github@outlook.com

… -- clang -- file.cc`

This PR update out lint tool so that it is possible to run:
`bazel run //tools/lint:check -- clang -- file.cc`

to check specific file.cc, and run:

`bazel run //tools/lint:lint -- clang -- file.cc`

to reformat specific file.cc.

In addition, this PR also adds support for black so that

`bazel run //tools/lint:lint -- black -- tensorflow_io/python/core/ops/version_ops.py` (for lint)

`bazel run //tools/lint:check -- black -- tensorflow_io/python/core/ops/version_ops.py` (for check)

could be used similiarly.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@yongtang
Copy link
Member Author

yongtang commented Mar 5, 2020

/cc @terrytangyuan I only used black for one file tensorflow_io/python/core/ops/version_ops.py and the CI does not invoke black yet.

Once your PR #812 is complete we can enable black for CI.

Also, you can run

bazel run //tools/lint:check -- black 

to check all, and run

bazel run //tools/lint:lint -- black 

to format all. (That will trigger lots of errors through so we may need to do it in piecemeal.)

@BryanCutler
Copy link
Member

Great! This will help a lot :)

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@yongtang yongtang merged commit 0da1825 into tensorflow:master Mar 5, 2020
@yongtang yongtang deleted the black branch March 5, 2020 19:40
i-ony pushed a commit to i-ony/io that referenced this pull request Feb 8, 2021
… -- clang -- file.cc` (tensorflow#837)

* Allows check/lint individual files with `bazel run //tools/lint:check -- clang -- file.cc`

This PR update out lint tool so that it is possible to run:
`bazel run //tools/lint:check -- clang -- file.cc`

to check specific file.cc, and run:

`bazel run //tools/lint:lint -- clang -- file.cc`

to reformat specific file.cc.

In addition, this PR also adds support for black so that

`bazel run //tools/lint:lint -- black -- tensorflow_io/python/core/ops/version_ops.py` (for lint)

`bazel run //tools/lint:check -- black -- tensorflow_io/python/core/ops/version_ops.py` (for check)

could be used similiarly.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Format tensorflow_io/core/python/ops/version_ops.py with black.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Fix setup.py

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants