Repository: AntonOsika/gpt-engineer
File: gpt_engineer/file_selector.py (Python)

Code before:
        user_input = input(
            "\nSelect files by entering the numbers separated by commas/spaces or "
            + "specify range with a dash. "
            + "Example: 1,2,3-5,7,9,13-15,18,20 (enter 'all' to select everything)"
            + "\n\nSelect files:"
        )
        selected_paths = []
        regex = r"\d+(-\d+)?([, ]\d+(-\d+)?)*"

        if user_input.lower() == "all":
            selected_paths = self.file_path_list
        elif re.match(regex, user_input):
            try:
                user_input = (
                    user_input.replace(
                        "", ",") if " " in user_input else user_input
                )
                selected_files = user_input.split(",")
                for file_number_str in selected_files:
                    if "-" in file_number_str:
                        start_str, end_str = file_number_str.split("-")
                        start = int(start_str)
                        end = int(end_str)
                        for num in range(start, end + 1):
                            selected_paths.append(
                                str(self.selectable_file_paths[num]))
                    else:
                        num = int(file_number_str)
                        selected_paths.append(
                            str(self.selectable_file_paths[num]))

            except ValueError:
                pass
        else:
            print("Please use a valid number/series of numbers.\n")
            sys.exit(1)

        return selected_paths


def is_in_ignoring_extensions(path: Path) -> bool:
    """
    Check if a path is not hidden or in the __pycache__ directory.

    Args:
        path: The path to check.

    Returns:
        bool: True if the path is not in ignored rules. False otherwise.
    """
    is_hidden = not path.name.startswith(".")

Review comment (suggestion):
I think this makes the CI break.

Have you configured your pre-commit hooks like described [here](https://github.com/AntonOsika/gpt-engineer/blob/main/.github/CONTRIBUTING.md)?

I think just

`pre-commit install`

Code after:
        user_input = input(
            "\nSelect files by entering the numbers separated by commas/spaces or "
            + "specify range with a dash. "
            + "Example: 1,2,3-5,7,9,13-15,18,20 (enter 'all' to select everything)"
            + "\n\nSelect files:"
        )
        selected_paths = []
        regex = r"\d+(-\d+)?([, ]\d+(-\d+)?)*"

        if user_input.lower() == "all":
            selected_paths = self.file_path_list
        elif re.match(regex, user_input):
            try:
                user_input = (
                    user_input.replace(" ", ",") if " " in user_input else user_input
                )
                selected_files = user_input.split(",")
                for file_number_str in selected_files:
                    if "-" in file_number_str:
                        start_str, end_str = file_number_str.split("-")
                        start = int(start_str)
                        end = int(end_str)
                        for num in range(start, end + 1):
                            selected_paths.append(str(self.selectable_file_paths[num]))
                    else:
                        num = int(file_number_str)
                        selected_paths.append(str(self.selectable_file_paths[num]))

            except ValueError:
                pass
        else:
            print("Please use a valid number/series of numbers.\n")
            sys.exit(1)

        return selected_paths


def is_in_ignoring_extensions(path: Path) -> bool:
    """
    Check if a path is not hidden or in the __pycache__ directory.

    Args:
        path: The path to check.

    Returns:
        bool: True if the path is not in ignored rules. False otherwise.
    """
    is_hidden = not path.name.startswith(".")
    is_pycache = "__pycache__" not in path.name
    return is_hidden and is_pycache