Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new user/beginner friendly errors system #505

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

NiumXp
Copy link
Contributor

@NiumXp NiumXp commented Jul 1, 2024

Hi, this is one of my drafts (maybe 7 months ago) focused on beginners (and quality of life) that I wrote for norminette when @matthieu42Network was accepting my PRs, I'm not sure if he's still available, but recently it seems like new people became collaborators, this made me happy and willing to continue with contributions.

New errors formatting

To use the new format is not necessary a new configuration, just run your norminette:

(.venv) niumxp@DESKTOP-LRN507C:~/oss/norminette$ cat -A test.c
#define exit 42$
$
int^IMain(void) {$
^Ireturn exit;$
}$
(.venv) niumxp@DESKTOP-LRN507C:~/oss/norminette$ norminette test.c
test.c:1:1 INVALID_HEADER Missing or invalid 42 header
test.c:1:9 MACRO_NAME_CAPITAL
     1 | #define exit 42
       |         ^^^^ Macro name must be capitalized
test.c:3:5 FORBIDDEN_CHAR_NAME
     3 | int Main(void) {
       |     ^^^^ user defined identifiers should contain only lowercase characters, digits or '_'
test.c:3:16 BRACE_NEWLINE
     3 | int Main(void) {
       |                ^ Expected newline before brace
test.c:4:12 RETURN_PARENTHESIS
     4 |     return exit;
       |            ^^^^ Return value must be in parenthesis

I added a red color to the errors:
image

@xtrm-en
Copy link

xtrm-en commented Sep 11, 2024

Subjective nit, this should probably have a bit more padding for readability's sake. Other than that, looks pretty amazing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants