c_formatter_42 icon indicating copy to clipboard operation
c_formatter_42 copied to clipboard

Does not break line when line is too long in header

Open MathieuSoysal opened this issue 10 months ago • 0 comments

Introduction

In this file header file, the formatter does not break line when line is too long :

Current format

#ifndef DOUBLE_LINKED_LIST_ESSENTIALS_H
# define DOUBLE_LINKED_LIST_ESSENTIALS_H

# include "../double_linked_list/double_linked_list_essentials.h"
# include "../node.h"

/**
 * @brief The structure of a double linked list
 */
typedef struct double_linked_list
{
	t_node				*head;
	t_node				*tail;
	unsigned int		size;
}						t_double_linked_list;

/**
 * @brief Create a new linked list, the linked list is LIFO (Last In First Out)
 * @return The new linked list
 */
t_double_linked_list	*double_linked_list_create(void);

/**
 * @brief Free the linked list and its content
 * @param obj The linked list to free
 * @param free_content The function to free the content of the linked list,
	can be NULL if the content is in stack
 */
void					double_linked_list_free(t_double_linked_list *obj,
							void (*free_content)(void *));

/**
 * @brief Remove head element from the linked list
 * @param obj The linked list to remove the last element
 * @param free_content The function to free the content of the linked list,
 * can be NULL if the content is in stack
 */
void					double_linked_list_remove_head(t_double_linked_list *obj,
							void (*free_content)(void *));

#endif // DOUBLE_LINKED_LIST_ESSENTIALS_H

Error line too long

image

Expected format

It should be :

#ifndef DOUBLE_LINKED_LIST_ESSENTIALS_H
# define DOUBLE_LINKED_LIST_ESSENTIALS_H

# include "../double_linked_list/double_linked_list_essentials.h"
# include "../node.h"

/**
 * @brief The structure of a double linked list
 */
typedef struct double_linked_list
{
	t_node				*head;
	t_node				*tail;
	unsigned int		size;
}						t_double_linked_list;

/**
 * @brief Create a new linked list, the linked list is LIFO (Last In First Out)
 * @return The new linked list
 */
t_double_linked_list	*double_linked_list_create(void);

/**
 * @brief Free the linked list and its content
 * @param obj The linked list to free
 * @param free_content The function to free the content of the linked list,
	can be NULL if the content is in stack
 */
void					double_linked_list_free(t_double_linked_list *obj,
							void (*free_content)(void *));

/**
 * @brief Remove head element from the linked list
 * @param obj The linked list to remove the last element
 * @param free_content The function to free the content of the linked list,
 * can be NULL if the content is in stack
 */
void					double_linked_list_remove_head(
							t_double_linked_list *obj,
							void (*free_content)(void *));

#endif // DOUBLE_LINKED_LIST_ESSENTIALS_H

MathieuSoysal avatar Apr 27 '24 12:04 MathieuSoysal