<!-- Thank you for your contribution! -->
<!-- Unless your change is trivial, please create an issue to discuss the change before creating a PR -->

## Change Summary

<!-- Please give a short summary of the changes. -->

Emit a warning when writing:

```python
class Model(Generic[T], BaseModel):
```

instead of:

```python
class Model(BaseModel, Generic[T]):
```

More generally, `BaseModel` must appear in the `__mro__` before `Generic`, so indirect subclasses are also checked. This means that `__class_getitem__` will use `BaseModel` instead of `Generic` and `Model[T]` will return a model class rather than a `_GenericAlias`.

## Related issue number

Closes https://github.com/pydantic/pydantic/issues/7845

Waiting for a reply to https://github.com/pydantic/pydantic/issues/6994#issuecomment-1773295810 before continuing here, but thought I should push what I have so far. The failing tests might be of interest.

## Checklist

* [x] The pull request title is a good summary of the changes - it will be used in the changelog
* [x] Unit tests for the changes exist
* [x] Tests pass on CI
* [x] Documentation reflects the changes where applicable
* [x] My PR is ready to review, **please add a comment including the phrase "please review" to assign reviewers**


Selected Reviewer: @dmontagu
Warn if a class inherits from Generic before BaseModel. <!-- Thank you for your contribution! -->
<!-- Unless your change is trivial, please create an issue to discuss the change before creating a PR -->

## Change Summary

<!-- Please give a short summary of the changes. -->

Emit a warning when writing:

```python
class Model(Generic[T], BaseModel):
```

instead of:

```python
class Model(BaseModel, Generic[T]):
```

More generally, `BaseModel` must appear in the `__mro__` before `Generic`, so indirect subclasses are also checked. This means that `__class_getitem__` will use `BaseModel` instead of `Generic` and `Model[T]` will return a model class rather than a `_GenericAlias`.

## Related issue number

Closes https://github.com/pydantic/pydantic/issues/7845

Waiting for a reply to https://github.com/pydantic/pydantic/issues/6994#issuecomment-1773295810 before continuing here, but thought I should push what I have so far. The failing tests might be of interest.

## Checklist

* [x] The pull request title is a good summary of the changes - it will be used in the changelog
* [x] Unit tests for the changes exist
* [x] Tests pass on CI
* [x] Documentation reflects the changes where applicable
* [x] My PR is ready to review, **please add a comment including the phrase "please review" to assign reviewers**


Selected Reviewer: @dmontagu
from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    foo: str


s = Settings()

s = Settings(foo='test', _case_sensitive=True, _env_prefix='test__', _env_file='test')

s = Settings(foo='test', _case_sensitive=1, _env_prefix=2, _env_file=3)


class SettingsWithConfigDict(BaseSettings):
    bar: str

    model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')


scd = SettingsWithConfigDict()

from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    foo: str


s = Settings()

s = Settings(foo='test', _case_sensitive=True, _env_prefix='test__', _env_file='test')

s = Settings(foo='test', _case_sensitive=1, _env_prefix=2, _env_file=3)


class SettingsWithConfigDict(BaseSettings):
    bar: str

    model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')


scd = SettingsWithConfigDict()
