bg ddlmZddlZddlmZddlmZmZmZddl m Z ddl m Z ddl mZmZddlmZdd lmZed ZGd d eZGd deZdS)) annotationsN)Sequence)Any NamedTupleTypeVar)nodes) PY38_PLUS) UNDEFINED Confidence)Message) UPDATE_OPTION_Tc|eZdZUded<dZded<dZded<dZded <eZd ed <dZ ded <dZ ded <dZ ded<dS) MessageTeststrmsg_idN int | Nonelineznodes.NodeNG | Nonenodez Any | NoneargszConfidence | None confidence col_offsetend_lineend_col_offset) __name__ __module__ __qualname____annotations__rrrr rrrrm/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pylint/testutils/output_line.pyrrsKKKD $D$$$$D$-J----!J!!!!H!%N%%%%r rceZdZUded<ded<ded<ded<ded<ded <ded <ded <ed d!dZed"dZed#dZe d d$dZ d%dZ ed&dZ dS)' OutputLinersymbolintlinenocolumnr end_lineno end_columnobjectmsgrTr check_endlineboolreturnc .||j}||j|}||j|}||j|j||||jpd|j dd|j j S)z+Create an OutputLine from a Pylint Message.z  ) _get_columnr'_get_py38_none_valuerr)r$robjr+replacername)clsr+r,r'rr)s r!from_msgzOutputLine.from_msg.s,,++CL-HH--cnmLL s J H    GMr GOOFD ) ) N    r str | intc2tsdSt|S)zvHandle column numbers except for python < 3.8. The ast parser in those versions doesn't return them. r)r r%)r's r!r2zOutputLine._get_column?s  16{{r valuer _T | Nonec|sdS|S)z|Used to make end_line and end_column None as indicated by our version compared to `min_pyver_end_position`. Nr)r;r,s r!r3zOutputLine._get_py38_none_valueJs  4 r rowSequence[str] | strc dt|tr|d} ||d}t |dkr]t jdtd||dt|d|dd|d |d tj St |d krYt jd td||dt|d|dd|d |d |dSt |d kr| |d |}| |d |}||dt|d|| || ||d|d |dSt#t$rMt jdd|dt t"|ddddddddcYSwxYw)ztCreate an OutputLine from a comma separated list (the functional tests expected output .txt files). ,zIn pylint 3.0 functional tests expected output should always include the expected confidence level, expected end_line and expected end_column. An OutputLine should thus have a length of 8.) stacklevelrNzIn pylint 3.0 functional tests expected output should always include the expected end_line and expected end_column. An OutputLine should thus have a length of 8.zZExpected 'msg-symbolic-name:42:27:MyClass.my_function:The message:CONFIDENCE' but we got ':zJ'. Try updating the expected output with: python tests/test_functional.py r0) isinstancersplitr2lenwarningswarnDeprecationWarningr%r r6r3_value_to_optional_int IndexError Exceptionjoinr UserWarning)r7r>r,r'rr)s r!from_csvzOutputLine.from_csvSsi c3   !))C..C4 9__SV,,F3xx1}} D' sFAKKFFN   3xx1}} %' sFCAKKtSVSVSQRV3xx1}}33CFMJJ 55c!fmLL sFAKK..x88..z::FFF     9 9 9 MR+.88C==RRBORR     3r1atRR88 8 8 8 9s'B G7A+G#B-GGAH/.H/-tuple[str, str, str, str, str, str, str, str]c 6t|jt|jt|jt|jt|jt|jt|jt|jfS)zZConvert an OutputLine to a tuple of string to be written by a csv-writer. ) rr$r&r'r(r)r*r+r)selfs r!to_csvzOutputLine.to_csvst               MM    r str | Nonec4|dks|sdSt|S)zCChecks if a (stringified) value should be None or a Python integer.NoneN)r%)r;s r!rRz!OutputLine._value_to_optional_ints" F??%?45zzr N)T)r+r r,r-r.r#)r'r9r.r%)r;rr,r-r.r<)r>r?r,r-r.r#)r.rX)r;r\r.r) rrrr classmethodr8 staticmethodr2r3rWr[rRrr r!r#r#$s$KKKKKKKKKKKK HHHOOO    [ \\=A>9>9>9>9[>9@     \r r#) __future__rrOcollections.abcrtypingrrrastroidrpylint.constantsr pylint.interfacesr r pylint.message.messager pylint.testutils.constantsr rrr#rr r!ris' #"""""$$$$$$++++++++++&&&&&&33333333******444444 WT]]     *   DDDDDDDDDDr