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

Fix trailing whitespace & empty lines #6385

Merged
merged 2 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ title: ''
labels: Bug
assignees: ''
---
<!--
NOTE: Please use Discussions for all incorrect or unexpected language analysis or
<!--
NOTE: Please use Discussions for all incorrect or unexpected language analysis or
statistics behaviour BEFORE opening a bug.

If you know how to fix this bug, please feel free to submit a Pull Request
with your fix; we don't need an issue first.
-->

## Describe the bug
<!--
Please provide a clear and detailed explanation of the bug you've found, and why
you consider it to be a bug.
<!--
Please provide a clear and detailed explanation of the bug you've found, and why
you consider it to be a bug.

Ideally, please provide steps to reproduce the bug and include the output from
Ideally, please provide steps to reproduce the bug and include the output from
using `github-linguist` on the command line.
-->

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/new_language.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assignees: ''

<!--

👋 If you have the time and know-how, send us a pull-request: everybody is welcome to contribute!
👋 If you have the time and know-how, send us a pull-request: everybody is welcome to contribute!
Otherwise, fill out the following fields as best you can.

-->
Expand Down
2 changes: 1 addition & 1 deletion docs/how-linguist-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The percentages are calculated based on the bytes of code for each language as r

## How Linguist works on github.com

When you push changes to a repository on github.com,
When you push changes to a repository on github.com,
a low priority background job is enqueued to analyze the [default branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches#about-the-default-branch) of your repository as explained above.
The results of this analysis are cached for the lifetime of your repository and are only updated when the repository is updated.
As this analysis is performed by a low priority background job, it can take a while, particularly during busy periods, for your language statistics bar to reflect your changes.
31 changes: 14 additions & 17 deletions ext/linguist/lex.linguist_yy.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L

/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
Expand All @@ -260,7 +260,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;

Expand Down Expand Up @@ -384,10 +384,10 @@ typedef size_t yy_size_t;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2

#define YY_LESS_LINENO(n)
#define YY_LINENO_REWIND_TO(ptr)

/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
Expand Down Expand Up @@ -1016,7 +1016,7 @@ extern int yywrap ( yyscan_t yyscanner );
#endif

#ifndef YY_NO_UNPUT

#endif

#ifndef yytext_ptr
Expand Down Expand Up @@ -2165,7 +2165,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner)
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;

b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
Expand Down Expand Up @@ -2231,7 +2231,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner)
}

b->yy_is_interactive = 0;

errno = oerrno;
}

Expand Down Expand Up @@ -2373,7 +2373,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner)
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;

if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
Expand Down Expand Up @@ -2409,7 +2409,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann
*/
YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
{

return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
}

Expand All @@ -2426,7 +2426,7 @@ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan
char *buf;
yy_size_t n;
int i;

/* Get memory for full buffer, including space for trailing EOB's. */
n = (yy_size_t) (_yybytes_len + 2);
buf = (char *) yyalloc( n , yyscanner );
Expand Down Expand Up @@ -2499,7 +2499,7 @@ int yyget_lineno (yyscan_t yyscanner)

if (! YY_CURRENT_BUFFER)
return 0;

return yylineno;
}

Expand All @@ -2512,7 +2512,7 @@ int yyget_column (yyscan_t yyscanner)

if (! YY_CURRENT_BUFFER)
return 0;

return yycolumn;
}

Expand Down Expand Up @@ -2574,7 +2574,7 @@ void yyset_lineno (int _line_number , yyscan_t yyscanner)
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
YY_FATAL_ERROR( "yyset_lineno called with no buffer" );

yylineno = _line_number;
}

Expand All @@ -2589,7 +2589,7 @@ void yyset_column (int _column_no , yyscan_t yyscanner)
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
YY_FATAL_ERROR( "yyset_column called with no buffer" );

yycolumn = _column_no;
}

Expand Down Expand Up @@ -2807,6 +2807,3 @@ void yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"

#line 173 "tokenizer.l"



4 changes: 2 additions & 2 deletions ext/linguist/lex.linguist_yy.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L

/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
Expand All @@ -263,7 +263,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;

Expand Down
1 change: 0 additions & 1 deletion ext/linguist/tokenizer.l
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,3 @@
.|\n { /* nothing */ }

%%

4 changes: 2 additions & 2 deletions lib/linguist/heuristics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ disambiguations:
- named_pattern: vb-class
- pattern: '^\s*BEGIN\R\s*MultiUse\s*=.*\R\s*Persistable\s*='
- language: VBA
named_pattern: vb-class
named_pattern: vb-class
- language: TeX
pattern: '^\s*\\(?:NeedsTeXFormat|ProvidesClass){'
- language: ObjectScript
Expand Down Expand Up @@ -258,7 +258,7 @@ disambiguations:
- language: Visual Basic 6.0
and:
- named_pattern: vb-form
- pattern: '^\s*Begin\s+VB\.Form\s+'
- pattern: '^\s*Begin\s+VB\.Form\s+'
- extensions: ['.fs']
rules:
- language: Forth
Expand Down
2 changes: 0 additions & 2 deletions script/build-grammars-tarball
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ cd "$(dirname "$0")/.."
rm -rf ./linguist-grammars
./script/grammar-compiler compile -o linguist-grammars || true
tar -zcvf linguist-grammars.tar.gz linguist-grammars


2 changes: 1 addition & 1 deletion test/test_file_blob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def test_vendored
# github.com
assert sample_blob(".github/CODEOWNERS").vendored?
assert sample_blob(".github/workflows/test.yml").vendored?

# obsidian.md settings
assert sample_blob(".obsidian/app.json").vendored?
assert sample_blob(".obsidian/plugins/templater-obsidian/main.js").vendored?
Expand Down
2 changes: 1 addition & 1 deletion test/test_heuristics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def test_fr_by_heuristics
"Text" => all_fixtures("Text", "*.fr")
})
end

def test_frm_by_heuristics
assert_heuristics({
"VBA" => all_fixtures("VBA", "*.frm"),
Expand Down
2 changes: 1 addition & 1 deletion test/test_samples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def test_filename_listed
end
end
end

def case_insensitive_glob(extension)
glob = ""
extension.each_char do |c|
Expand Down