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

CI: Unify code_checks whitespace checking #30755

Merged
merged 108 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from 98 commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
d16e566
CI: Unify tests cases
Jan 6, 2020
6e6bb66
Changed functions name
Jan 6, 2020
48f3e86
Renamed file name, back to the original
Jan 7, 2020
2e249a8
STY: inconsistent linebreaks
Jan 7, 2020
f611e26
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 7, 2020
4ec704c
Made the code check "ID" to be more verbose
Jan 7, 2020
8b2f603
Added ".py" in ci/code_check.sh to the script call
Jan 7, 2020
63dbeb7
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 8, 2020
bb5b905
Replaced the dictonary with 'globals()'
Jan 8, 2020
2225175
Changed from "id" to "validation-type"
Jan 8, 2020
a2b60c5
Better explained (I hope) why this file exists
Jan 8, 2020
590ca48
Yielding the string directly instead of assigning it to a variable
Jan 8, 2020
ef00c68
Fixed indentation in docs
Jan 8, 2020
9341623
Imporved docstring for spaces test case, as datapythonista suggested
Jan 8, 2020
c0f800d
Removed uppercase "MSG" from docs and replaced it with lowercase "msg"
Jan 8, 2020
63b39dd
Fixed comment placement
Jan 8, 2020
2b61e53
Applied datapythonista suggestions
Jan 8, 2020
e18efbb
Moved "main" function to the bottom (Above 'if __name__ == "__main__"')
Jan 8, 2020
68c79d1
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 8, 2020
b60f5ee
Imporved test case in 'strings_with_wrong_placed_space' validation type
Jan 8, 2020
a4ec49e
Added more logic to 'strings_with_wrong_placed_space'
Jan 9, 2020
6718bb8
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 10, 2020
8dccf05
Added some typings
Jan 10, 2020
84c7125
Defining 'TYPE' as constant
Jan 10, 2020
b623c2f
Added 'continue' for code block
Jan 10, 2020
74c1abb
Added comment about token.NEWLINE
Jan 10, 2020
a1e1833
Applied datapythonsita code suggestion
Jan 10, 2020
052102e
Replaced available_validation_types with predefined list of available…
Jan 10, 2020
b784985
Make the validation type parameter to be required
Jan 10, 2020
09ec060
Added 'VALUE' constant
Jan 10, 2020
4793526
Fixed grammer mistake (I think)
Jan 10, 2020
60614c7
Removed complex if statement, Replaced with a function
Jan 10, 2020
7c87685
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 12, 2020
3904888
Removed useless parenthasis
Jan 12, 2020
48762f9
Fix tests case for 'strings_with_wrong_placed_space'
Jan 12, 2020
b1ac49e
Removed constants and replaced with values from the generated named t…
Jan 12, 2020
f9add47
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 12, 2020
c83aeb6
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 13, 2020
eef1062
Fixed CI-test for 'strings_with_wrong_placed_space'
Jan 13, 2020
b66705e
Activating "strings_with_wrong_placed_space" in the CI
Jan 13, 2020
0419125
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 13, 2020
1b5ce95
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 13, 2020
f77ed82
Refactored the function that check the unwanted patterns of the wrong…
Jan 13, 2020
93c6543
Added docs
Jan 13, 2020
256ae10
Changed function name
Jan 13, 2020
4822615
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 13, 2020
a67c60a
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 14, 2020
7f4a579
Rearanged functions in alphabetical order
Jan 14, 2020
88e09d1
Renamed strings_with_wrong_placed_space --> strings_with_wrong_placed…
Jan 14, 2020
fc24720
Fixed bug where not report wrong placed whitespace if string had a pr…
Jan 14, 2020
07c4446
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 14, 2020
e4957db
Changed validation-type call name in the CI as well
Jan 14, 2020
2f83a99
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 14, 2020
b206569
Eleborate more about bare_pytest_raises error message
Jan 14, 2020
9feac86
Removed empty line below 'Examples'
Jan 14, 2020
11b0a3b
Renamed "whitespace_validation" function to --> "has_wrong_whitespaces"
Jan 14, 2020
3b2de94
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 14, 2020
d1a6182
Removed useless function, with a brilliant idea
Jan 14, 2020
de7ded0
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 15, 2020
7ce199f
Refactored the validation-type functions, to get a file object
Jan 15, 2020
4678174
Moved the "readline" to the function itself.
Jan 15, 2020
68bbe58
Added some sample tests
Jan 16, 2020
f3b7c02
Changed functions names in the sample test
Jan 16, 2020
886195c
Changed the names of the test functions as well
Jan 16, 2020
9839384
Refactored tests
Jan 16, 2020
8263c2b
Added tests to TestStringsToConcatenate
Jan 16, 2020
5b0ce29
Fixed typing
Jan 16, 2020
02aa4ce
Added tests for TestStringsWithWrongPlacedWhitespace
Jan 16, 2020
b2d2d62
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 17, 2020
952721f
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 18, 2020
caa1bed
Changed paramerter description of "file_obj"
Jan 18, 2020
5e1d723
Fixed typo
Jan 18, 2020
da9d4f9
Refactored test to use "pytest.mark.parametrize"
Jan 19, 2020
b5361f7
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 19, 2020
4cc1aee
Added edge cases tests "for bare_pytest_raises"
Jan 19, 2020
796550e
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 20, 2020
ddccb5b
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 20, 2020
e82599d
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 23, 2020
740fbf0
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 24, 2020
49445eb
Type annotations
Jan 24, 2020
74e5548
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 24, 2020
66bc298
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 25, 2020
6a0f45d
Making a function for getting the literal string prefix length
Jan 25, 2020
2cb32d8
Calling io.StringIO inside the bare_pytests_raises tests
Jan 25, 2020
c98a3a4
Calling io.StringIO inside the strings_to_concatenate and strings_wit…
Jan 25, 2020
6b8bc43
Changed comment to something more clear
Jan 25, 2020
95f2275
Unify bare_pytest_raises tests
Jan 25, 2020
4a00e51
Unify strings_to_concatenate and strings_with_wrong_placed_whitespace…
Jan 25, 2020
4a01f6f
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Jan 30, 2020
289c667
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Feb 1, 2020
b96d8ca
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Feb 7, 2020
7f1c88a
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Feb 14, 2020
421ffa6
Seperated test case
Feb 14, 2020
7cbde16
Splitted test cases
Feb 14, 2020
a2a12fc
Update scripts/validate_string_concatenation.py
ShaharNaveh Feb 14, 2020
ff6ba11
Typing change as @WillAyd suggested
Feb 14, 2020
b1568f1
Reverted a2a12fc39417721c5722e0fb9fbe17aff698e556
Feb 14, 2020
9ef9db7
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Feb 15, 2020
32a715d
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Feb 22, 2020
460be1a
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Feb 27, 2020
7fa0c5a
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Feb 28, 2020
f7f4342
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Mar 6, 2020
d0e606f
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Mar 13, 2020
c7d9d52
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Mar 14, 2020
c672375
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Mar 19, 2020
0ba7539
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Mar 20, 2020
81990ca
Merge remote-tracking branch 'upstream/master' into CI-unify-boilerplate
Mar 21, 2020
f2897f5
Merge branch 'master' into CI-unify-boilerplate
ShaharNaveh Mar 23, 2020
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: 10 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,17 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then

MSG='Check for use of not concatenated strings' ; echo $MSG
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
$BASE_DIR/scripts/validate_string_concatenation.py --format="[error]{source_path}:{line_number}:{msg}" .
$BASE_DIR/scripts/validate_string_concatenation.py --validation-type="strings_to_concatenate" --format="##[error]{source_path}:{line_number}:{msg}" .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curiosity, what does the ## here mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full disclosure I have no clue, I asked @datapythonista for the output format that it should be outputted when running on github-actions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a convention in GitHub Actions. Any row in the output that starts with ##[error] is highlighted as an error, and it's easier to find in the logs.

else
$BASE_DIR/scripts/validate_string_concatenation.py .
$BASE_DIR/scripts/validate_string_concatenation.py --validation-type="strings_to_concatenate" .
fi
RET=$(($RET + $?)) ; echo $MSG "DONE"

MSG='Check for strings with wrong placed spaces' ; echo $MSG
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
$BASE_DIR/scripts/validate_string_concatenation.py --validation-type="strings_with_wrong_placed_whitespace" --format="##[error]{source_path}:{line_number}:{msg}" .
else
$BASE_DIR/scripts/validate_string_concatenation.py --validation-type="strings_with_wrong_placed_whitespace" .
fi
RET=$(($RET + $?)) ; echo $MSG "DONE"

Expand Down
Loading