bazel-mypy-integration icon indicating copy to clipboard operation
bazel-mypy-integration copied to clipboard

[QUESTION]: How does this project relate to your bazel-linting-system project?

Open cgrindel opened this issue 4 years ago β€’ 3 comments

Will the bazel-mypy-integration be superseded by the bazel-linting-system?

Thanks, again, for your efforts on both fronts.

cgrindel avatar Apr 08 '20 14:04 cgrindel

bazel-linting-system I made before bazel-mypy-integration and was concerned with applying lint changes to source code, whereas bazel-mypy-integration won’t change your source code and will just spit out errors.

So while they are related, the former is an attempt answer to the question "can I replace all our bash scripts and config that run our linters in CI with a Bazel integrated system that will be cleaner and faster?" The latter was created just to get MyPy running in our Bazel build so we stopped checking in incorrect types.

Linter tools that will take in source code files (only) and spit out linted source code files include Ruby's rubocop and Python's black, but MyPy isn't in this class of tool as it requires a view of source code dependencies and can accept typing stub files.

I hadn't thought of using the former in the latter until a coworker asked the same question as you. I’d say that MyPy is too complex for the current capabilities of bazel-linting-system, but with further work on bazel-linting-system maybe its responsibilities will grow beyond linters that format code to more complex static code analysis/typing tools like MyPy for Python and eslint for Typescript.

thundergolfer avatar Apr 08 '20 23:04 thundergolfer

As it stands now, are the two actually orthogonal? In contributing to bazel-mypy-integration I'm tripping over

ERROR: /home/alexeagle/Projects/bazel-mypy-integration/examples/third_party/BUILD:3:10: MirrorAndLint third_party/__linting_system/main/third_party/main.py failed: (Exit 127): main_linter_exe failed: error executing command bazel-out/k8-fastbuild/bin/third_party/main_linter_exe third_party/__linting_system/main 'third_party/main.py;bazel-out/k8-fastbuild/bin/third_party/__linting_system/main/third_party/main.py'

Use --sandbox_debug to see verbose messages from the sandbox
bazel-out/k8-fastbuild/bin/third_party/main_linter_exe: line 30: /usr/local/bin/black: No such file or directory

and rather than debug/repair/workaround that, I wonder if we should just remove the linting_system hooks from the mypy repo for now?

EDIT: I think it was just the extra .bazelrc: https://github.com/bazel-contrib/bazel-mypy-integration/pull/59

alexeagle avatar May 06 '22 13:05 alexeagle

@alexeagle I think remove bazel-linting-system. It was an experimental system I dropped into the mypy-integration in the early days, but it remained experimental and I don't think bazel-mypy-integration should carry it around.

thundergolfer avatar May 10 '22 06:05 thundergolfer