langflow icon indicating copy to clipboard operation
langflow copied to clipboard

make init is failing as githooks dir war removed on 0.6.9 release

Open mehadi82 opened this issue 10 months ago • 3 comments

[Describe the bug make init command is failing with error message

Browser and Version

  • Version 0.6.16

To Reproduce

  1. open a terminal on the repo's root directory
  2. run make init

Screenshots image

Additional context It it failing for a missing file which was removed under the following commit https://github.com/langflow-ai/langflow/commit/4bec4dee4b0de4db78972c763b542647497fe9f3#diff-87320095d7c4f39eed5d8f3866b512eb910e4eec8e7926faaeef6a53ab786fcb

mehadi82 avatar Apr 17 '24 01:04 mehadi82

@mehadi82 Did you find any solutions?

pseudo-usama avatar May 07 '24 07:05 pseudo-usama

@mehadi82 Did you find any solutions?

Yes. I will create a PR for this tonight EST time

M-H-Mukit avatar May 10 '24 18:05 M-H-Mukit

Hi, @M-H-Mukit did you submit any pull request?

pseudo-usama avatar May 16 '24 10:05 pseudo-usama

Hi @pseudo-usama

I apologize for missing my commitment. I forgot and was occupied with other priorities. I'm not sure if you still need it, but for reference, I'm sharing the code here.

#!/bin/sh

added_files=$(git diff --name-only --cached --diff-filter=d)

# Sort the imports
git diff --name-only --cached | grep '\.py$' | xargs -r poetry run ruff check --select I --fix

# Run the formatter
make format

exit_code=$?

if [ $exit_code -ne 0 ]; then
    echo "make format command failed with exit code $exit_code"
    exit $exit_code
fi

git add ${added_files}

Add the above code in the following file image

M-H-Mukit avatar Jun 03 '24 15:06 M-H-Mukit

And here is the PR https://github.com/langflow-ai/langflow/pull/2051

M-H-Mukit avatar Jun 03 '24 15:06 M-H-Mukit

Hi @pseudo-usama

I have just discovered that there is a better approach introduced in the repo and here is the yaml to handle the pre-commit https://github.com/langflow-ai/langflow/blob/dev/.pre-commit-config.yaml

If you have the latest code from the dev branch, I think you no longer face the issue on running make init

M-H-Mukit avatar Jun 03 '24 16:06 M-H-Mukit