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 linter #8

Closed
alvarofpp opened this issue Jan 18, 2022 · 1 comment
Closed

Add linter #8

alvarofpp opened this issue Jan 18, 2022 · 1 comment
Assignees
Milestone

Comments

@alvarofpp
Copy link
Member

No description provided.

@alvarofpp alvarofpp self-assigned this Jan 18, 2022
@alvarofpp alvarofpp added this to the 2022T1 milestone Jan 18, 2022
alvarofpp added a commit that referenced this issue Feb 9, 2022
@alvarofpp
Copy link
Member Author

I changed Makefile lint command to:

.PHONY: lint
lint:
	@docker pull ${DOCKER_LINTER_IMAGE}
	@docker run --rm -v ${ROOT}:/app ${DOCKER_LINTER_IMAGE} " \
		lint-commit ${LINT_COMMIT_TARGET_BRANCH} \
		&& lint-markdown \
		&& lint-python urnai"

I used make lint > errors.txt to get all occurrences of errors.

The code to count the number of occurrences of each error:

import re
from collections import Counter

# Counts the number of occurrences of each error
with open('errors.txt', 'r') as file_errors:
  errors = [re.search('[A-Z]{1}[0-9]{3}', row).group(0) for row in file_errors.readlines()]
  counter = Counter(errors)

We have a total of 5954 errors.


Error groups

Error group Occurrences Description
C8 40 Missing trailing comma
D2 134 Whitespace issues
D3 73 Quotes issues
D4 116 Docstring content issues
E1 190 Indentation
E2 1145 Whitespace
E3 283 Blank line
E4 62 Import
E5 782 Line length
E7 72 Statement
F4 766 Module
F5 1 %
F8 54 Variable (underfined name)
I1 249 Import statements
I2 162 Import groups
Q0 964 Quotes
W1 1 Indentation warning
W2 842 Whitespace warning
W3 16 Blank line warning
W6 2 Deprecation warning

Top 10 errors

Code Occurrences Description or example message
Q000 849 remove bad quotes
E501 782 line too long (82 > 79 characters)
W291 600 trailing whitespace
F405 566 name may be undefined, or defined from star imports: module
E203 353 whitespace before ,, ; or :
E265 273 block comment should start with #
W293 231 blank line contains whitespace
I100 225 your import statements are in the wrong order
E231 195 missing whitespace after ,, ; or :
F401 191 module imported but unused

All errors

Code Occurrences
C812 37
C815 2
C819 1
D200 30
D202 7
D204 13
D205 59
D208 21
D210 1
D211 3
D300 73
D400 64
D401 51
D403 1
E101 1
E111 2
E114 11
E116 4
E117 11
E122 34
E124 3
E127 35
E128 86
E129 1
E131 2
E201 15
E202 35
E203 353
E211 10
E221 4
E225 55
E231 195
E251 176
E252 2
E261 13
E262 7
E265 273
E266 7
E301 6
E302 166
E303 108
E305 3
E401 16
E402 46
E501 782
E701 19
E703 1
E711 40
E713 4
E722 6
E741 2
F401 191
F403 9
F405 566
F523 1
F811 19
F821 12
F841 23
I100 225
I101 24
I201 153
I202 9
Q000 849
Q001 41
Q002 73
Q003 1
W191 1
W291 600
W292 11
W293 231
W391 16
W605 2

@Cogitus Cogitus closed this as completed in e2bb7b0 Apr 6, 2022
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

No branches or pull requests

1 participant