MCPcopy Index your code

hub / github.com/sqlfluff/sqlfluff / functions

Functions2,340 in github.com/sqlfluff/sqlfluff

↓ 5 callersMethodget_templater
Instantiate the configured templater.
src/sqlfluff/core/config/fluffconfig.py:473
↓ 5 callersMethodignore_masked_violations
Remove any violations specified by ignore_mask. This involves two steps: 1. Filter out violations affected by single-line "noqa" dire
src/sqlfluff/core/rules/noqa.py:329
↓ 5 callersMethodis_qualified
Return if there is more than one element to the reference.
src/sqlfluff/dialects/dialect_ansi.py:1116
↓ 5 callersMethoditer_blocks
(self, elements: ReflowSequenceType)
src/sqlfluff/utils/reflow/reindent.py:135
↓ 5 callersFunctionload_config_up_to_path
Loads a selection of config files from both the path and its parent paths. Args: path (str): The directory which is the target of the sea
src/sqlfluff/core/config/loader.py:259
↓ 5 callersMethodload_raw_file_and_config
Load a raw file and the associated config.
src/sqlfluff/core/linter/linter.py:122
↓ 5 callersMethodmake_child_from_path
Make a child config at a path but pass on overrides and extra_config_path. Args: path (str): The path to load the new config obje
src/sqlfluff/core/config/fluffconfig.py:477
↓ 5 callersMethodmake_raw_slice_info
Create RawSliceInfo as given, or "empty" if in set/macro block.
src/sqlfluff/core/templaters/slicers/tracer.py:515
↓ 5 callersMethodnormalize
Returns the normalized version of a string using the segment's rules. By default this uses the raw value of the segment. E.g. This re
src/sqlfluff/core/parser/segments/raw.py:187
↓ 5 callersMethodparse_path
Parse a path of sql files. NB: This a generator which will yield the result of each file within the path iteratively.
src/sqlfluff/core/linter/linter.py:1245
↓ 5 callersMethodparse_rendered
Parse a rendered file.
src/sqlfluff/core/linter/linter.py:397
↓ 5 callersFunctionpriority_keyword_merge
Merge keyword lists, giving priority to entries in later lists. *args is a list of keyword lists, these lists should be of tuples in the form
src/sqlfluff/dialects/dialect_postgres_keywords.py:13
↓ 5 callersMethodprocess_raw_file_for_config
Process a full raw file for inline config and update self. Args: raw_str (str): The full SQL script to evaluate for inline config
src/sqlfluff/core/config/fluffconfig.py:721
↓ 5 callersMethodraw_slices_spanning_source_slice
Return a list of the raw slices spanning a set of indices.
src/sqlfluff/core/templaters/base.py:312
↓ 5 callersMethodraw_trimmed
Return a trimmed version of the raw content. Returns: str: The trimmed version of the raw content.
src/sqlfluff/core/parser/segments/raw.py:163
↓ 5 callersMethodrespace
Returns a new :obj:`ReflowSequence` with points respaced. Args: strip_newlines (:obj:`bool`): Optionally strip newlines
src/sqlfluff/utils/reflow/sequence.py:481
↓ 5 callersMethodrule_tuples
A simple pass through to access the rule tuples of the rule set.
src/sqlfluff/core/linter/linter.py:110
↓ 5 callersFunctionset_logging_level
Set up logging for the CLI. We either set up global logging based on the verbosity or, if `logger` is specified, we only limit to a single
src/sqlfluff/cli/commands.py:159
↓ 5 callersFunctionstructural_parse_mode_test
Test the structural function of a grammar in various parse modes. This helper fixture is designed to modularise grammar tests.
test/core/parser/grammar/conftest.py:14
↓ 5 callersMethodtemplated_position
Return the line and position of this marker in the source.
src/sqlfluff/core/parser/markers.py:152
↓ 5 callersMethodto_dict
Serialise this LintFix as a dict.
src/sqlfluff/core/rules/fix.py:129
↓ 5 callersFunctionvalidate_config_dict
Validate a config dict. Currently we validate: - Removed and deprecated values. - Layout configuration structure. - Indentation confi
src/sqlfluff/core/config/validate.py:192
↓ 5 callersMethodwrap
Wrap this result with an outer class. NOTE: Because MatchResult is frozen, this returns a new match.
src/sqlfluff/core/parser/match_result.py:158
↓ 5 callersFunctionzero_slice
Construct a zero slice from a single integer.
src/sqlfluff/core/helpers/slice.py:22
↓ 4 callersMethod__init__
( self, raw_class: type[RawSegment], type: Optional[str] = None, optional: boo
src/sqlfluff/core/parser/parsers.py:28
↓ 4 callersMethod__setattr__
Overwrite BaseSegment's __setattr__ with BaseSegment's superclass.
src/sqlfluff/core/parser/segments/raw.py:92
↓ 4 callersMethod_cast_fix_list
Generate list of fixes to convert CONVERT and ShorthandCast to CAST.
src/sqlfluff/rules/convention/CV11.py:88
↓ 4 callersMethod_check_trail_lead_shortcut
Check to see whether we should pass the rule and shortcut. Args: segment: The target segment. parent: The parent segm
src/sqlfluff/rules/layout/LT03.py:92
↓ 4 callersMethod_choose_anchor_segment
Choose the anchor point for a lint fix, i.e. where to apply the fix. From a grammar perspective, segments near the leaf of the tree are
src/sqlfluff/core/rules/base.py:780
↓ 4 callersMethod_convert_fix_list
Generate list of fixes to convert CAST and ShorthandCast to CONVERT.
src/sqlfluff/rules/convention/CV11.py:136
↓ 4 callersMethod_flatten_optional
Flatten optional grammar (e.g., exclude). Returns GrammarId or None.
utils/build_parsers.py:207
↓ 4 callersMethod_get_jinja_env
Get a properly configured jinja environment. This method returns a properly configured jinja environment. It first checks if the 'ign
src/sqlfluff/core/templaters/jinja.py:390
↓ 4 callersMethod_get_target
Get a dbt target name from the configuration.
plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py:421
↓ 4 callersMethod_is_code_or_meta
(segment: BaseSegment)
src/sqlfluff/core/parser/segments/base.py:1220
↓ 4 callersMethod_is_segment_semicolon
Check if a segment is a semicolon statement terminator.
src/sqlfluff/rules/convention/CV06.py:62
↓ 4 callersMethod_level_to_int
(level: Union[ObjectReferenceLevel, int])
src/sqlfluff/dialects/dialect_ansi.py:1172
↓ 4 callersMethod_match_at
Construct a MatchResult at a given index. This is a helper function for reuse by other parsers.
src/sqlfluff/core/parser/parsers.py:70
↓ 4 callersFunction_resolve_paths_in_config
Attempt to resolve any paths found in the config file. NOTE: This method is recursive to crawl the whole config object, and also mutates the
src/sqlfluff/core/config/file.py:60
↓ 4 callersMethod_shorthand_fix_list
Generate list of fixes to convert CAST and CONVERT to ShorthandCast.
src/sqlfluff/rules/convention/CV11.py:178
↓ 4 callersMethod_substring_occurrences
Find every occurrence of the given substrings.
src/sqlfluff/core/templaters/python.py:507
↓ 4 callersMethod_tokens_to_segments
Convert tokens to segments.
src/sqlfluff/core/parser/lexer.py:921
↓ 4 callersFunction_violations
Return all parse errors, including unparsable nodes anywhere in the tree. Top-level parse failures surface in parsed.violations, but content that
test/dialects/oracle_test.py:15
↓ 4 callersMethodadd
Adds the fix and updates stats. We also allow potentially multiple source fixes on the same anchor by condensing them together here.
src/sqlfluff/core/linter/fix.py:31
↓ 4 callersMethodanalyze
Slice template in jinja.
src/sqlfluff/core/templaters/slicers/tracer.py:542
↓ 4 callersMethodapply
Actually this match to segments to instantiate. This turns a theoretical match into a nested structure of segments. We handle child
src/sqlfluff/core/parser/match_result.py:197
↓ 4 callersFunctionapply_recursion_limit
Set the Python recursion limit from CLI flag or config, with validation.
src/sqlfluff/cli/commands.py:47
↓ 4 callersFunctionassert_rule_fail_in_sql
Assert that a given rule does fail on the given sql. Args: code (str): The code of the rule to test. sql (str): The SQL text to c
src/sqlfluff/utils/testing/rules.py:115
↓ 4 callersFunctionassert_rule_pass_in_sql
Assert that a given rule doesn't fail on the given sql.
src/sqlfluff/utils/testing/rules.py:190
↓ 4 callersFunctionbenchmark_files
Benchmark a list of SQL files. Args: sql_files: List of SQL files to benchmark use_rust: Whether to use Rust parser itera
utils/benchmark_parsing.py:156
↓ 4 callersMethodcheck_tuple
Get a tuple representing this error. Mostly for testing.
src/sqlfluff/core/errors.py:125
↓ 4 callersFunctionconfig_overrides_for_fixture
Build config overrides for a fixture, including deep recursion cases.
test/conftest.py:46
↓ 4 callersMethodcopy
Copy the segment recursively, with appropriate copying of references. Optionally provide child segments which have already been dealt
src/sqlfluff/core/parser/segments/base.py:931
↓ 4 callersMethodcount_segments
Returns the number of segments in this segment.
src/sqlfluff/core/parser/segments/base.py:788
↓ 4 callersFunctiondict_diff
Work out the difference between two dictionaries. Returns a dictionary which represents elements in the `left` dictionary which aren't in the
src/sqlfluff/core/helpers/dict.py:79
↓ 4 callersMethodevaluate
Evaluate the test case. NOTE: This method is designed to be run in a pytest context and will call methods such as `pytest.skip()` as
src/sqlfluff/utils/testing/rules.py:53
↓ 4 callersMethodextract_possible_references
Extract possible references of a given level. "level" may be (but is not required to be) a value from the ObjectReferenceLevel enum d
src/sqlfluff/dialects/dialect_ansi.py:1141
↓ 4 callersMethodfrom_parent
Generate a DepthMap from all the children of a segment. NOTE: This is the most efficient way to construct a DepthMap due to caching i
src/sqlfluff/utils/reflow/depthmap.py:132
↓ 4 callersFunctiongenerate_source_patches
Use the fixed tree to generate source patches. Importantly here we deduplicate and sort the patches from their position in the templated file
src/sqlfluff/core/linter/patch.py:266
↓ 4 callersFunctionget_consumed_whitespace
A helper function to extract possible consumed whitespace. Args: segment (:obj:`RawSegment`, optional): A segment to test for
src/sqlfluff/utils/reflow/elements.py:38
↓ 4 callersMethodget_end_loc
Get a location tuple at the end of this segment.
src/sqlfluff/core/parser/segments/base.py:828
↓ 4 callersMethodget_raw
Get the current raw representation.
src/sqlfluff/utils/reflow/sequence.py:101
↓ 4 callersMethodget_type
Returns the type of this segment as a string.
src/sqlfluff/core/parser/segments/base.py:784
↓ 4 callersMethodget_violations
Get a list of violations, respecting filters and ignore options. Optionally now with filters.
src/sqlfluff/core/linter/linted_file.py:122
↓ 4 callersFunctionidentifiers_policy_applicable
Does `(un)quoted_identifiers_policy` apply to this segment? This method is used in CP02, RF04 and RF05.
src/sqlfluff/utils/identifers.py:11
↓ 4 callersMethodinsert
Returns a new :obj:`ReflowSequence` with the new element inserted. Insertion is always relative to an existing element. Either before
src/sqlfluff/utils/reflow/sequence.py:343
↓ 4 callersMethodis_comment
Return True if this segment is a comment.
src/sqlfluff/core/parser/segments/raw.py:104
↓ 4 callersMethodis_optional
Return whether this segment is optional. The optional attribute is set in the __init__ method.
src/sqlfluff/core/parser/grammar/base.py:175
↓ 4 callersFunctioniter_records_from_nested_dict
Walk a config dict and get config elements. >>> list( ... iter_records_from_nested_dict( ... {"foo":{"bar":{"baz": "a", "biz":
src/sqlfluff/core/helpers/dict.py:166
↓ 4 callersMethodlint_fix_parsed
Lint and optionally fix a tree object.
src/sqlfluff/core/linter/linter.py:455
↓ 4 callersMethodmatch
Match against this matcher. NOTE: We check that the segment is also code to avoid matching unexpected comments.
src/sqlfluff/core/parser/parsers.py:260
↓ 4 callersMethodmatch
Match against this matcher. NOTE: This method's case sensitivity is based on objects ignore_case property
src/sqlfluff/core/parser/parsers.py:319
↓ 4 callersMethodnext_slice_id
Returns a new, unique slice ID.
src/sqlfluff/core/templaters/slicers/tracer.py:425
↓ 4 callersMethodparse
Parse a series of lexed tokens using the current dialect.
src/sqlfluff/core/parser/parser.py:30
↓ 4 callersFunctionparse_ansi_string
Parse an ansi sql string for testing.
test/utils/reflow/sequence_test.py:13
↓ 4 callersMethodpasses_filter
Returns true if this segment considered at all. This method is called during crawling but also in evaluating the anchors for linting
src/sqlfluff/core/rules/crawlers.py:18
↓ 4 callersMethodpersist_changes
Persist changes to files in the given path. This also logs the output as we go using the formatter if present.
src/sqlfluff/core/linter/linted_dir.py:210
↓ 4 callersMethodpersist_tree
Persist changes to the given path.
src/sqlfluff/core/linter/linted_file.py:390
↓ 4 callersFunctionprint_results
Print benchmark results.
utils/benchmark_parser.py:128
↓ 4 callersMethodregister
Decorate a class with this to add it to the ruleset. .. code-block:: python @myruleset.register class Rule_LT01(BaseRu
src/sqlfluff/core/rules/base.py:959
↓ 4 callersFunctionrun_command
Run a command and report status. Args: cmd: Command and arguments as list description: Human-readable description Returns:
docsv/scripts/generate-all-docs.py:16
↓ 4 callersMethodstats
Return a dict containing linting stats about this path.
src/sqlfluff/core/linter/linted_dir.py:201
↓ 4 callersFunctiontime_function
A basic timing function.
examples/02_timing_api_steps.py:12
↓ 4 callersMethodto_source_dict
Serialise the source position.
src/sqlfluff/core/parser/markers.py:289
↓ 4 callersMethodtop
Get the uuid on top of the stack.
src/sqlfluff/core/parser/lexer.py:80
↓ 4 callersFunctiontrim_to_terminator
Trim forward segments based on terminators. Given a forward set of segments, trim elements from `segments` to `tail` by using a `greedy_match
src/sqlfluff/core/parser/match_algorithms.py:657
↓ 4 callersFunctionvalidate_config_dict_for_removed
Validates a config dict against removed values. Where a value can be updated or translated, it mutates the config object. In general the `re
src/sqlfluff/core/config/removed.py:178
↓ 4 callersFunctionwrap_field
Wrap a field (label, val). Returns: A dict of {label_list, val_list, sep_char, lines}
src/sqlfluff/cli/helpers.py:35
↓ 3 callersMethod__init__
( self, *args: Union[Matchable, str], exclude: Optional[Matchable] = None, ter
src/sqlfluff/core/parser/grammar/anyof.py:257
↓ 3 callersMethod__resolve_wild_query
Attempt to resolve a full query which may contain wildcards. NOTE: This requires a ``Query`` as input rather than just a ``Selectable
src/sqlfluff/rules/ambiguous/AM07.py:59
↓ 3 callersMethod_apply
Shim function used in parallel mode.
src/sqlfluff/core/linter/runner.py:233
↓ 3 callersFunction_assert_node_limit_error
(err: SQLParseError, limit: int)
test/core/parser/max_parse_nodes_test.py:33
↓ 3 callersFunction_create_file_path
(example: ParseExample, ext: str = ".yml")
test/generate_parse_fixture_yml.py:72
↓ 3 callersFunction_deduce_line_current_indent
Deduce the current indent string. This method accounts for both literal indents and indents consumed from the source as by potential templati
src/sqlfluff/utils/reflow/reindent.py:1190
↓ 3 callersFunction_ensure_pytest_logging
Ensure pytest logging components are available.
src/sqlfluff/utils/testing/logging.py:31
↓ 3 callersMethod_extract_referenced_tables
( self, segment: BaseSegment, allow_unqualified: bool = False )
src/sqlfluff/rules/structure/ST11.py:110
↓ 3 callersMethod_extract_tokens_from_segments
Extract RsToken objects from RawSegments. This extracts the cached _rstoken attribute from segments that came from the Rust l
src/sqlfluff/core/parser/rust_parser.py:449
↓ 3 callersMethod_find_node
(self, fname, config=None, dbt_dir=os.getcwd())
plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py:569
↓ 3 callersMethod_find_slice_indices_of_templated_pos
Find a subset of the sliced file which touch this point. NB: the last_idx is exclusive, as the intent is to use this as a slice.
src/sqlfluff/core/templaters/base.py:279
↓ 3 callersFunction_format_toml_parse_error
Build a user-facing TOML parsing error message.
src/sqlfluff/core/config/toml.py:53
↓ 3 callersMethod_get_indent_segment
Get the current indent segment (if there). NOTE: This only returns _untemplated_ indents. If templated newline or whitespace segments
src/sqlfluff/utils/reflow/elements.py:328
← previousnext →201–300 of 2,340, ranked by callers