Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This needs a way to match directories for changes in monorepos. E.g. run this linter only if there were changes in this directory.


An abstraction via a script should work, right? They document that it pipes the JSON data to your command's stdin,

  ```lint-monorepo.sh

  # read that data
  json_input=$(cat)

  # do some parsing here with jq, get the file path (file_path)

  if [$file_path" == "$dir1"*]
    run lint_for_dir1
  ```


Set up pre-commit and call that from a hook? That's what we have


Whatever you run in the hook can check whatever conditions you want.


This can be implemented at the line level if the linter is Git aware




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: