git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] userdiff: add builtin driver for typescript language

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 5, 2024, 17:43 UTC
Message-ID
<xmqqedbjvh7e.fsf@gitster.g>
In-Reply-To
<20240404163827.5855-1-utsavp0213@gmail.com>
Utsav Parmar <utsavp0213@gmail.com> writes:
> Subject: Re: [PATCH v2] userdiff: add builtin driver for typescript language

"builtin driver" -> "patterns", probably, as the "userdiff" customization does not allow adding any new code.

Show 10 quoted lines
> diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
> index 4338d023d9..4461c41054 100644
> --- a/Documentation/gitattributes.txt
> +++ b/Documentation/gitattributes.txt
> @@ -902,6 +902,8 @@ patterns are available:
>  
>  - `tex` suitable for source code for LaTeX documents.
>  
> +- `typescript` suitable for source code for TypeScript language.
> +

Good that you did not forget to add an entry to this list (and to the right place).

Show 21 quoted lines
> diff --git a/t/t4018/typescript-function-assignment b/t/t4018/typescript-function-assignment
> new file mode 100644
> index 0000000000..49c528713e
> --- /dev/null
> +++ b/t/t4018/typescript-function-assignment
> @@ -0,0 +1,4 @@
> +const RIGHT = function(one: number): Type {
> +    someMethodCall();
> +    return ChangeMe;
> +}
> diff --git a/t/t4018/typescript-interface b/t/t4018/typescript-interface
> new file mode 100644
> index 0000000000..6f3665c2af
> --- /dev/null
> +++ b/t/t4018/typescript-interface
> @@ -0,0 +1,4 @@
> +interface RIGHT {
> +  one?: string;
> +  [propName: ChangeMe]: any;
> +}
> \ No newline at end of file

I do not speak typescript, but is it important for the language that the sources can be stored with an incomplete line at the end of the file? IOW, I am wondering if it is deliberate *and* matters to the tests that some sample files end with an incomplete line while others do not.

If that is not the case, please fix this and the next file; we do not generally want a file with an incomplete line at the end unless there is a compelling reason to (i.e., we do test that our tools work with such files, and it may be convenient to ship sample input with incomplete lines to run such tests).

As to the actual pattern and the words the patterns catch, I have no idea if they are sensible for typescript language---folks with more experience than myself should lend their eyeballs to review.

Thanks.
Previous: Utsav ParmarNext: Junio C Hamano
Message 8 of 10 in “userdiff: add funcname regex and wordregex for typescript language”
  1. Utsav ParmarMar 19, 2024
  2. Patrick SteinhardtMar 21, 2024
  3. Utsav ParmarMar 23, 2024
  4. userdiff: add builtin driver for typescript languageUtsav Parmar, Mar 24, 2024
  5. Patrick SteinhardtMar 25, 2024
  6. Karthik NayakMar 25, 2024
  7. userdiff: add builtin driver for typescript languageUtsav Parmar, Apr 4, 2024
  8. Junio C HamanoApr 5, 2024
  9. Junio C HamanoApr 5, 2024
  10. Patrick SteinhardtMar 25, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.