PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 131
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE # Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Utility functions for configuration testing.""" from __future__ import annotations import copy import json import logging import re import unittest from pathlib import Path from typing import Any, Dict from unittest.mock import Mock from pylint.constants import PY38_PLUS from pylint.lint import Run # We use Any in this typing because the configuration contains real objects and constants # that could be a lot of things. ConfigurationValue = Any PylintConfiguration = Dict[str, ConfigurationValue] if not PY38_PLUS: # We need to deepcopy a compiled regex pattern # In python 3.6 and 3.7 this requires a hack # See https://stackoverflow.com/a/56935186 copy._deepcopy_dispatch[type(re.compile(""))] = lambda r, _: r # type: ignore[attr-defined] def get_expected_or_default( tested_configuration_file: str | Path, suffix: str, default: str, ) -> str: """Return the expected value from the file if it exists, or the given default.""" expected = default path = Path(tested_configuration_file) expected_result_path = path.parent / f"{path.stem}.{suffix}" if expected_result_path.exists(): with open(expected_result_path, encoding="utf8") as f: expected = f.read() # logging is helpful to realize your file is not taken into # account after a misspelling of the file name. The output of the # program is checked during the test so printing messes with the result. logging.info("%s exists.", expected_result_path) else: logging.info("%s not found, using '%s'.", expected_result_path, default) return expected EXPECTED_CONF_APPEND_KEY = "functional_append" EXPECTED_CONF_REMOVE_KEY = "functional_remove" def get_expected_configuration( configuration_path: str, default_configuration: PylintConfiguration ) -> PylintConfiguration: """Get the expected parsed configuration of a configuration functional test.""" result = copy.deepcopy(default_configuration) config_as_json = get_expected_or_default( configuration_path, suffix="result.json", default="{}" ) to_override = json.loads(config_as_json) for key, value in to_override.items(): if key == EXPECTED_CONF_APPEND_KEY: for fkey, fvalue in value.items(): result[fkey] += fvalue elif key == EXPECTED_CONF_REMOVE_KEY: for fkey, fvalue in value.items(): new_value = [] for old_value in result[fkey]: if old_value not in fvalue: new_value.append(old_value) result[fkey] = new_value else: result[key] = value return result def get_related_files( tested_configuration_file: str | Path, suffix_filter: str ) -> list[Path]: """Return all the file related to a test conf file ending with a suffix.""" conf_path = Path(tested_configuration_file) return [ p for p in conf_path.parent.iterdir() if str(p.stem).startswith(conf_path.stem) and str(p).endswith(suffix_filter) ] def get_expected_output( configuration_path: str | Path, user_specific_path: Path ) -> tuple[int, str]: """Get the expected output of a functional test.""" exit_code = 0 msg = ( "we expect a single file of the form 'filename.32.out' where 'filename' represents " "the name of the configuration file, and '32' the expected error code." ) possible_out_files = get_related_files(configuration_path, suffix_filter="out") if len(possible_out_files) > 1: logging.error( "Too much .out files for %s %s.", configuration_path, msg, ) return -1, "out file is broken" if not possible_out_files: # logging is helpful to see what the expected exit code is and why. # The output of the program is checked during the test so printing # messes with the result. logging.info(".out file does not exists, so the expected exit code is 0") return 0, "" path = possible_out_files[0] try: exit_code = int(str(path.stem).rsplit(".", maxsplit=1)[-1]) except Exception as e: # pylint: disable=broad-except logging.error( "Wrong format for .out file name for %s %s: %s", configuration_path, msg, e, ) return -1, "out file is broken" output = get_expected_or_default( configuration_path, suffix=f"{exit_code}.out", default="" ) logging.info( "Output exists for %s so the expected exit code is %s", configuration_path, exit_code, ) return exit_code, output.format( abspath=configuration_path, relpath=Path(configuration_path).relative_to(user_specific_path), ) def run_using_a_configuration_file( configuration_path: Path | str, file_to_lint: str = __file__ ) -> tuple[Mock, Mock, Run]: """Simulate a run with a configuration without really launching the checks.""" configuration_path = str(configuration_path) args = ["--rcfile", configuration_path, file_to_lint] # We do not capture the `SystemExit` as then the `runner` variable # would not be accessible outside the `with` block. with unittest.mock.patch("sys.exit") as mocked_exit: # Do not actually run checks, that could be slow. We don't mock # `PyLinter.check`: it calls `PyLinter.initialize` which is # needed to properly set up messages inclusion/exclusion # in `_msg_states`, used by `is_message_enabled`. check = "pylint.lint.pylinter.check_parallel" with unittest.mock.patch(check) as mocked_check_parallel: runner = Run(args) return mocked_exit, mocked_check_parallel, runner