Skip to content

Commit

Permalink
chore: merge pull request #80 from magalhaesm/norminette-fix
Browse files Browse the repository at this point in the history
fix: address latest norminette v3.3.55 update incompatibility issue
  • Loading branch information
magalhaesm authored Apr 4, 2024
2 parents 11bbc1a + c9d731a commit 6339445
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
- uses: actions/checkout@v3

# Runs a set of commands using the runners shell
- name: Set up Criterion framework on Ubuntu 22.04
- name: Set up Criterion framework and norminette on Ubuntu 22.04
run: |
sudo apt-get install libcriterion-dev
sudo apt-get install -y libcriterion-dev
python3 -m pip install --upgrade pip setuptools
python3 -m pip install norminette
python3 -m pip install norminette==3.3.51
# Runs a single command using the runners shell
- name: Run norminette validation
run: norminette include src
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@

The 8th project of 42 cursus syllabus asks students to implement a simplified shell. It's about minishell, as beautiful as a shell.

As the project's subject states, the existence of shells is linked to the very existence of IT. At the time, al developers agreed that _communicating with a computer using aligned 1/0 swiches was seriously irritating_. It was only logical that they came up with the idea of creating a software to communicate with a computer using interactive lines of commands in a language somehat close to the human language.
As the project's subject states, the existence of shells is linked to the very existence of IT. At the time, all developers agreed that _communicating with a computer using aligned 1/0 swiches was seriously irritating_. It was only logical that they came up with the idea of creating a software to communicate with a computer using interactive lines of commands in a language somewhat close to the human language.

## How to compile and run the project

#### 1) Copy this repository to your local workstation

```html
git@github.com:magalhaesm/minishell.git
git clone https://github.com/magalhaesm/minishell.git
```

#### 2) Install the required libraries to run the functions from readline library

```html
sudo apt-get install libreadline6 libreadline6-dev
sudo apt-get install -y libreadline6 libreadline6-dev
```

#### 3) Compile the project with Makefile
Expand Down
7 changes: 4 additions & 3 deletions include/exec.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/* ::: :::::::: */
/* exec.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mdias-ma <mdias-ma@student.42sp.org.br> +#+ +:+ +#+ */
/* By: yde-goes <yde-goes@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/13 11:45:35 by mdias-ma #+# #+# */
/* Updated: 2023/01/20 17:57:26 by mdias-ma ### ########.fr */
/* Updated: 2024/04/04 13:07:57 by yde-goes ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -27,7 +27,8 @@
# define PIPE_LIMIT 1024
# define HEREDOC_TEMPFILE "/tmp/heredoc_tempfile"

typedef struct s_context {
typedef struct s_context
{
int fd[2];
int pid[PIPE_LIMIT];
int fd_close;
Expand Down
7 changes: 4 additions & 3 deletions include/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/* ::: :::::::: */
/* parser.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mdias-ma <mdias-ma@student.42sp.org.br> +#+ +:+ +#+ */
/* By: yde-goes <yde-goes@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/24 09:49:48 by mdias-ma #+# #+# */
/* Updated: 2022/12/21 14:40:55 by mdias-ma ### ########.fr */
/* Updated: 2024/04/04 13:08:39 by yde-goes ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -16,7 +16,8 @@
# include "scanner.h"
# include "tree.h"

typedef enum e_nonterminal {
typedef enum e_nonterminal
{
LIST = 0,
PIPELINE = LIST,
CMD = LIST,
Expand Down
16 changes: 10 additions & 6 deletions include/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/* ::: :::::::: */
/* tree.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mdias-ma <mdias-ma@student.42sp.org.br> +#+ +:+ +#+ */
/* By: yde-goes <yde-goes@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/30 15:36:15 by mdias-ma #+# #+# */
/* Updated: 2022/12/24 11:03:19 by mdias-ma ### ########.fr */
/* Updated: 2024/04/04 13:08:10 by yde-goes ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -15,7 +15,8 @@

# include "scanner.h"

typedef enum e_node_type {
typedef enum e_node_type
{
COMMAND,
AND,
OR,
Expand All @@ -30,17 +31,20 @@ typedef enum e_node_type {
typedef struct s_node t_node;
typedef char ** t_command;

typedef struct s_operand {
typedef struct s_operand
{
t_node *left;
t_node *right;
} t_operand;

typedef union u_node_value {
typedef union u_node_value
{
t_command cmd;
t_operand pair;
} t_node_value;

typedef struct s_node {
typedef struct s_node
{
t_node_type type;
t_node_value data;
} t_node;
Expand Down
4 changes: 2 additions & 2 deletions src/builtins/cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: yde-goes <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/24 19:00:09 by yde-goes #+# #+# */
/* Updated: 2023/01/01 19:15:34 by mdias-ma ### ########.fr */
/* Updated: 2024/04/04 13:08:29 by yde-goes ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -69,7 +69,7 @@ static char *handle_special_cd(char **args)
{
getcwd(pwd, PATH_MAX);
return (pwd);
}
}
else if (arg_len == 2 && ft_strncmp(args[1], "..", 2) == 0)
dir_param = "..";
return (dir_param);
Expand Down
6 changes: 3 additions & 3 deletions src/table/hash_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/* ::: :::::::: */
/* hash_table.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mdias-ma <mdias-ma@student.42sp.org.br> +#+ +:+ +#+ */
/* By: yde-goes <yde-goes@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/09 17:39:31 by mdias-ma #+# #+# */
/* Updated: 2022/12/15 21:10:47 by mdias-ma ### ########.fr */
/* Updated: 2024/04/04 13:08:21 by yde-goes ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -56,7 +56,7 @@ t_entry *find_entry(t_entry *entries, int capacity, char *key)
return (entry);
}
else if (tombstone == NULL)
tombstone = entry;
tombstone = entry;
}
else if (ft_strncmp(entry->key, key, ft_strlen(key)) == 0)
return (entry);
Expand Down

0 comments on commit 6339445

Please sign in to comment.